vue element ui 导航刷新 is-active


   <el-menu :default-active="$route.path" router  mode="horizontal">
		<el-menu-item v-for="route in routes" :key="route.path" :index="route.path" :class="$route.path==route.path?'is-active':''">{{route.name}}</el-menu-item>
   </el-menu>

js:

routes: [
	{ path: '/main/kdgadmin', name: '幼儿园管理', },
	{ path: '/main/phyex', name: '体测', },

	]

css:
.is-active{
		background: #a3212f;
		border-bottom: 0px solid transparent;
		color: #FFFFFF;
	}



posted @ 2017-10-20 14:25  Y.anCy  阅读(10041)  评论(0编辑  收藏  举报