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()