2018-05-04 elementUI这个表格组件,怎么写路由
2018-05-04 本文已影响0人
remix_huang
本项目基于 vue-element-admin 具体调用方法需要看一下
页面中:
//需要用router-link把将要路由的按钮包起来
<template slot-scope="scope">
<router-link style="margin-right:15px;" :to="{ path:'courseclassupdate'}">
<el-button type="default" size="mini">编辑</el-button>
</router-link>
<el-button @click="handleDelete(scope.row)" type="danger" size="mini">删除</el-button>
</template>
//或者使用@click绑定一个事件 然后在methods中:
router(){
this.$router.push('courseclassupdate')
}
//然后在router->index.js中配置一下
export const constantRouterMap = [
{
path: '/general',
component: Layout,
name: 'General',
meta: { title: '常规设置', icon: 'form' },
children: [
{
path: 'order',
name: 'General-order',
component: () => import('@/views/general/order'),
meta: { title: '订单管理', icon: 'form' }
},
{
path: 'courseclassupdate',
name: 'General-courseclassupdate',
component: () => import('@/views/general/courseclassupdate'),
meta: { title: '课程及班级编辑', icon: 'form' }, hidden: true
}
]
}
]
关于作者
var myproject = {
nickName : "remix_huang",
site : "https://www.jianshu.com/u/717e2ca57b3f"
}