09 2021 档案

摘要:数组[1,2] ,转为数组对象 [ {num:1},{num:2}] let arr=[] for (let i in this.subData.p){ var j={} j.num=this.subData.p[i] arr.push(j) } // 结果 'p':[{num:1}] 阅读全文
posted @ 2021-09-18 14:53 小十六哇 阅读(1933) 评论(0) 推荐(0)
摘要:关于Vue子调用父方法的问题,有三种方法 1. 直接在子中通过this.$parent.event来调用父组件的方法 父组件 <template> <div> <child></child> </div> </template> <script> import child from '@/child 阅读全文
posted @ 2021-09-13 16:33 小十六哇 阅读(1534) 评论(0) 推荐(0)