摘要: 1.创建Vue实例 //main.js Vue.prototype.$bus = new Vue(); 2.发射事件 //GoodsList this.$bus.$emit("aaa") 3.监听事件 //home.vue this.$bus.$on("aaa",()=>{ this.$refs.s 阅读全文
posted @ 2020-08-01 22:15 Wayhome' 阅读(13366) 评论(0) 推荐(1) 编辑
摘要: 链接:https://www.cnblogs.com/czy960731/p/9288830.html 链接:https://blog.csdn.net/wangguoyu1996/article/details/80628135 阅读全文
posted @ 2020-08-01 20:06 Wayhome' 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 一、bug原因 由于网络请求是异步操作,所以在渲染页面的时候,数据还没有过来,就可能会有下面的报错 <span> <img :src="commentInfo.user.avatar" alt="" class="avatar"> </span> 数据结构: 二、定义数据模板 提前定义好数据模板: 阅读全文
posted @ 2020-08-01 17:55 Wayhome' 阅读(5085) 评论(0) 推荐(0) 编辑
摘要: props: { commentInfo: { type: Array, default() { return []; } } }, //这里的type是一个数组,但是父传子时却传过来一个对象,所以报错 //把type和return改回Object即可 props: { commentInfo: { 阅读全文
posted @ 2020-08-01 16:24 Wayhome' 阅读(2244) 评论(0) 推荐(0) 编辑
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css