vue.js
C_阿乐
这个作者很懒,什么都没留下…
展开
-
vue中组件间传值使用typeScript
vue中组件间传值使用typeScript1.子传父2.父传子1.子传父与vue中的没有太多区别在子组件中定义点击事件 $emit传递<view class="cu-item" @click="changeMonth(item)" > 内容内容 </view>// 在方法中写changeMonth(item:any) { this.$emit("listenEvent", this.year+ '-' +item)原创 2020-08-20 11:58:15 · 533 阅读 · 0 评论 -
Vue.js slot 插槽的使用最新笔记
Vue slot 插槽使用/*步骤:1.注册局部组件 或者 全局组件 挂载节点template 使用模板字符串挂载节点template中模板需要写入子组件插入内容的位置 slot插槽 插入 取名 由于绑定 v_slot:取的名2.创建一个Vue实例 el挂载节点为HTML类名 或者 标签components为子组件 属性名可以作为标签使用(组件的属性名都可以...原创 2019-11-05 18:01:57 · 266 阅读 · 0 评论