摘要: 父组件向子组件传值 1. 组件内部通过props接收传递过来的值 Vue.component('menu-item', { props: ['title'], template: '<div>{{ title }}</div>' }) 2. 父组件通过属性将值传递给子组件 例 <!DOCTYPE h 阅读全文
posted @ 2021-11-02 15:37 一纸年华 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 全局组件注册语法 1.组件注册语法 Vue.component(组件名称, { data: 组件数据, template: 组件模板内容 }) // 注册一个名为 button-counter 的新组件 Vue.component('button-counter', { data: function 阅读全文
posted @ 2021-11-02 11:24 一纸年华 阅读(300) 评论(0) 推荐(0) 编辑
摘要: el-carouse组件是自带鼠标事件,要修改则需要清除原有事件,即鼠标的移入事件@mouseenter.native="delHandleMouseEnter"。 <el-carousel ref="carousel" trigger="click" arrow="always" height=" 阅读全文
posted @ 2021-11-02 09:40 一纸年华 阅读(2720) 评论(0) 推荐(0) 编辑