摘要: 组件的加载与keep-alive keep-alive状态缓存,保持状态 A.组件 <template> <div>vueA{{msg}} <button class="" @click="changeactive" type="button">保持状态</button></div></templa 阅读全文
posted @ 2019-08-06 23:11 星雨,恒奋斗,过客 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1.父组件向子组件传递数据通过props; 2.子组件传递父组件数据需要通过自定义事件; $emit("定义事件",数据); 父组件: <!-- 模版 --><template> <!-- 只能存在一个根容器--> <div class="main"><p style="font-weight:bo 阅读全文
posted @ 2019-08-06 21:41 星雨,恒奋斗,过客 阅读(534) 评论(0) 推荐(0) 编辑