鍍金池/ 問答/HTML/ v-for動態(tài)生成router-link的 :to傳參怎么寫

v-for動態(tài)生成router-link的 :to傳參怎么寫

<router-link :to=list.url>{{list.title}}</router-link>

data(){
    return {
        navLists: [
            {title: '監(jiān)控中心', url: '/watchCenter'},
            {title: '統(tǒng)計分析', url: '/analysis'},
            {title: '業(yè)務管理', url: '/serviceManager'},
            {title: '系統(tǒng)管理', url: '/systemManager'}
        ]
    }      
}

這是rouer.js
{
            path: '/container',
            name: 'container',
            component: container,
            children: [
                {path: '/watchCenter/:id', component: sideMenu,redirect: '/watchCenter/manage1',
                    children: [
                        {path: '/watchCenter/manage1', component: mainContent},
                        {path: '/watchCenter/edit1', component: mainContent1}
                    ]
                },
                
                
回答
編輯回答
笨尐豬
2017年5月21日 15:12