vue3低代码

93 阅读1分钟

vue3不含ts,解决ts报错:www.cnblogs.com/liujunhang/…

复杂组件用 jsx 编写更为便捷、灵活,template 编写会复杂化。

场景:父组件props -> 子组件,经由 computed() 计算属性 动态获取结果值。 结果:不使用 reactive() 不能实现类似 v-model 双向绑定,因此使用 ref() 。 :modelValue="" @update:modelValue=""

vue3的 provide() 具有响应式,vue2 中没有。

解析vue3-template工具地址:Vue 3 Template Explore

辅助线显示:

  1. 纵向辅助线

image.png

image.png

image.png

  1. 横向辅助线

image.png

手动挂载组件方法:

  • vue2中使用 new SubComponent.$mount()
  • vue3中使用 document.body.appendChild((render(vNode, el),el))

vue3中的插槽都是一个函数