摘要:
在vue项目中添加watch监听routes: watch: {//动态监听路由变化 -以便动态更改导航背景色事件效果等 '$route' (to, from) { // 对路由变化作出响应... console.log('to.path ',to.path)//跳转后路由 console.log( 阅读全文
摘要:
只要更改i-con 去掉type,改为自己class样式 原项目 <a-menu-item key="/ManageProject" @click='navSelect("/ManageProject")'> <router-link to="/ManageProject"> <a-icon typ 阅读全文
摘要:
在创建项目后(不带路由的项目)使用路由 项目步骤 1:安装 cnpm install --save vue-router 2:新建配置文件 在src下创建router文件夹:内创建index.js 3:导入和挂在(都在根入口main.js): import router from "./router 阅读全文
摘要:
v-if:style <tr v-if="v[2].length>0" v-for="(a,i) in v[2]" :style="v[9]?('background:#e6e6e6'):('background:#fff')"> v-if:class :class="[selectedIndex= 阅读全文
摘要:
组件在实际项目中的使用 自动封装组件 封装组件后组件间传值 父传子props 子传父$emit 组件事件的调用 在父组件内 组件标签添加ref=‘自定义名’ this.$refs.自定义组件名.子组件方法 组件插槽-套入数据或分开布局 slot的使用就像它的名字一样, 在组件内定义一块空间, 取名为 阅读全文