關(guān)鍵詞:路由
<div id="app">
<h1>服務(wù)政策</h1>
<ul>
<li><router-link to="/after">售后服務(wù)</router-link></li>
<li><router-link to="/other">三包支持</router-link></li>
</ul>
<router-view ></router-view>
<router-view name="a"></router-view>
<router-view name="b"></router-view>
</div>
const Foo = { template: '<div>7天無理由退貨</div>' }
const Bar = { template: '<div>兩年質(zhì)保</div>' }
const Baz = { template: '<div>免費(fèi)升級固件</div>' }
const router = new VueRouter({
routes: [
{ path: '/after',
components: {
default: Foo,
a: Bar,
b: Baz
}
},
{
path: '/other',
components: {
default: Baz,
a: Bar,
b: Foo
}
}
]
})
new Vue({
router,
el: '#app'
})