1、 vue3.0 移除了this.$scopedSlots
属性
const slots = this.$slots.default
变更为const slots = this.$slots.default()
- 替换
this.$scopedSlots
属性 因为getSlot
函数接收的slot
和scopedSlot
意义一致
// 变更前
computeChildrenAndOffsets(
slots,
this.$slots,
this.$scopedSlots
)
// 变更后
computeChildrenAndOffsets(
slots,
this.$slots,
this.$slots
)`
2、 vue3.0 render(h)
中的h
变更为全局导入,而不是作为参数传递给渲染函数
- 引入
h
函数
import { h } from 'vue'
- 去除
render
函数默认参数
render(h)变更为render()