博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Vue【路由】
阅读量:172 次
发布时间:2019-02-28

本文共 1008 字,大约阅读时间需要 3 分钟。

路由

    
    首页
    发现
    订单
    我的

css样式

子路由(ele为例)

    

css样式

动态路由

以一个例子来说

    首页
    发现
    订单
    我的
var Index= {
template:`
{
{$route.params.type}}
`, created() {
console.log(this.$route.params.type) }, } const routes=[ //动态路由的动态参数其实就是params参数中的键 //使用路由跳转时拼接进入的变量就是键值对中的值 {
path:'/:type', component:Index } ] const router = new VueRouter({
routes })

转载地址:http://lzij.baihongyu.com/

你可能感兴趣的文章