摘要: 作用:用于子组件中触发父组件方法并传值 使用一:$emit //子组件中 <template> <button @click="handleChildEvent">子组件中触发的事件</button> </template> <script> export default { name:'Child 阅读全文
posted @ 2023-09-27 16:00 天官赐福· 阅读(4758) 评论(0) 推荐(1) 编辑
摘要: 适用场景: 如果要改变data中的对象或者数组,会发现data数据改变了,但是页面上并没有更新 如: this.list[index].sex = '男'; 此时要想更新可以使用 this.$set(this.list[index],'sex','男') 也可以使用 this.list[index] 阅读全文
posted @ 2023-09-27 15:35 天官赐福· 阅读(889) 评论(0) 推荐(0) 编辑
返回顶端