随笔分类 - vue
摘要:1、子组件暴露插槽的写法 <template> <div class="hello"> <h1>子组件</h1> <h1>↓↓↓以下是默认插槽内容↓↓↓</h1> <slot :scope="sexEn1"></slot> <h1>↑↑↑以上是插槽内容↑↑↑</h1> <br /> <div>{{s
阅读全文
摘要:vue3中子组件向父组件暴露方法并传值,同样兼容老写法1、父组件 <template> <div class="home"> <h1>父组件</h1> <img alt="Vue logo" src="../assets/logo.png" /> <HelloWorld @changeMsg="ch
阅读全文
摘要:只贴出了vue3中新的子父组件传值,V3兼容老的写法就不再赘述1、父组件 <template> <div class="home"> <h1>父组件</h1> <img alt="Vue logo" src="../assets/logo.png" /> <HelloWorld :msg="msg"
阅读全文
摘要:vue3中,实现数据驱动,在写法上有了改变 <template> <div style="cursor:pointer;" @click="changeWord">{{world}}</div> </template> <script> import { reactive, toRefs } fro
阅读全文
摘要:1、弃用钩子“beforeDestroy”、“destroyed”ESlint检查 2、钩子的变化 <template> <div> </div> </template> <script> export default { setup() { console.log('setup'); }, bef
阅读全文
摘要:1、创建命令的变化 用vue3命令创建xx项目:vue create "xx" 注:vue3在创建项目时,只能使用小写字母,以及亲和url的字符,否则将会报错 vue create m+ 创建项目时报错:Error: name can only contain URL-friendly charac
阅读全文

浙公网安备 33010602011771号