老师,新建layout.vue和直接用app.vue有啥不同,如果用app.vue,components下的组件path怎么写呀

来源:6-1 项目框架搭建(layout、路由切换)

悬崖冰

2017-08-17

怎么让Hello.vue显示在comB中呢

http://szimg.mukewang.com/59956a8900015a4004090119.jpg

http://szimg.mukewang.com/59956a8900016f7505760639.jpg


写回答

1回答

fishenal

2017-08-21

看一下这里吧

https://router.vuejs.org/zh-cn/essentials/named-views.html



const router = new VueRouter({  routes: [    {      path: '/',      components: {        default: Foo,        a: Bar,        b: Baz      }    }  ] })



<router-view class="view one"></router-view><router-view class="view two" name="a"></router-view><router-view class="view three" name="b"></router-view>

0
3
悬崖冰
回复
fishenal
好的,我试试,谢谢老师
2017-08-22
共3条回复

最容易上手的Vue2.0入门实战教程

快速入门Vue2.0,组件化开发一个数字产品电商平台

3966 学习 · 999 问题

查看课程