09 2023 档案
摘要:作用:用于子组件中触发父组件方法并传值 使用一:$emit //子组件中 <template> <button @click="handleChildEvent">子组件中触发的事件</button> </template> <script> export default { name:'Child
阅读全文
摘要:适用场景: 如果要改变data中的对象或者数组,会发现data数据改变了,但是页面上并没有更新 如: this.list[index].sex = '男'; 此时要想更新可以使用 this.$set(this.list[index],'sex','男') 也可以使用 this.list[index]
阅读全文