摘要: <!DOCTYPE html Document A组件 destroy msg:{{msg}} //生命周期:初始化阶段 运行中阶段 销毁阶段 Vue.component("aaa",{ template:" aaa", data:function(){ return {msg:'hello'} } 阅读全文
posted @ 2018-08-13 23:57 -柒孟- 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 一、通过路由带参数进行传值 1、两个组件 A和B,A组件通过query把orderId传递给B组件(触发事件可以是点击事件、钩子函数等) this.$router.push({ path: '/conponentsB', query: { orderId: 123 } }) // 跳转到B 2、在B 阅读全文
posted @ 2018-08-13 20:33 -柒孟- 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1、元素获取 / 原生js / var ele = document.getElementById('idName'); var eleArr = document.getElementsByClassName('className'); var eleArr = document.getEleme 阅读全文
posted @ 2018-08-13 17:24 -柒孟- 阅读(2005) 评论(0) 推荐(2) 编辑