摘要: vue常用传参方式 一、组件通信——vue中父子组件间的方法调用和参数传递props、$emit 1 父传子 <!-- 父组件father.vue --> <template> <div> <div>这里是father组件</div> <div>这是父组件要传给子组件的参数:{{msg}}</div 阅读全文
posted @ 2021-09-16 09:05 太阳东升西落 阅读(957) 评论(0) 推荐(1)
摘要: 动态路由:让多个组件使用同一个挂载点,并根据需求动态切换. 基础语法: <div id="example"> <button @click="change">切换页面</button> <component :is="currentView"></component> </div> <script> 阅读全文
posted @ 2021-09-16 08:51 太阳东升西落 阅读(301) 评论(0) 推荐(1)