我是vue.js的新手,在启动vue应用时无法弄清楚如何加载和渲染路线。例如(见下面的链接)如何呈现"路径的组件:' /'"当应用程序加载时目前,只有在点击链接时才会加载。
jsfiddle complete example here
const router = new VueRouter({
mode: 'history',
routes: [
{ path: '/',
// a single route can define multiple named components
// which will be rendered into <router-view>s with corresponding names.
components: {
default: Foo,
a: Bar,
b: Baz
}
},
{
path: '/other',
components: {
default: Baz,
a: Bar,
b: Foo
}
}
]
})
new Vue({
router,
el: '#app'
})