2018-05-04 elementUI这个表格组件,怎么写路由跳转

本项目基于 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"

  }

最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容