
vue学习笔记
Luminary7
这个作者很懒,什么都没留下…
展开
-
vue组件之间的传值
1、父组件 传 子组件 父组件:<子组件 :变量=数据></子组件> 子组件:props:[‘变量’] ** 2、子组件 传 父组件 ** 子组件: this.$emit(“自定义事件名称”,“值”) 父组件: 3、兄弟组件之间的传值 testA.vue <template> <div> AA <button v-on:click="sendMsg">向组件传值</button> &l原创 2021-04-09 13:58:29 · 111 阅读 · 0 评论 -
vue组件的创建和引用
创建: src/component ===>创建组件 注意:组件首字母大写 引用: 1、import xxx from ‘xxx’ 2、 components:{ xxx } 3、在template 中使用:xxx <template> <div> <header>头部</header> <Swiper></Swiper> <Footer></Footer>原创 2021-04-02 11:24:54 · 167 阅读 · 0 评论