鍍金池/ 問(wèn)答/HTML/ vue vue-router怎么使用

vue vue-router怎么使用

在用vue-cli官方腳手架的時(shí)候,不知道從何入手;
像下面的
我像在HelloWorld.vue中引入firstcomponet.vue;用router-link引入組件,看頁(yè)面是生效了,但是如何處理兩者之間的路由關(guān)系,以及在firstcomponet.vue中如何處理數(shù)據(jù)操作?
各位大佬,新手勿噴!

clipboard.png

clipboard.png

回答
編輯回答
六扇門
2017年12月2日 02:30
編輯回答
拮據(jù)

vue-router官網(wǎng)有詳細(xì)的介紹,建議先把官網(wǎng)全部實(shí)踐一遍,再入手項(xiàng)目

2018年4月20日 15:08
編輯回答
別瞎鬧

寫過(guò)一篇路由基礎(chǔ)篇,你可以參考下,不過(guò)建議還是先看文檔。

2018年8月20日 20:14
編輯回答
風(fēng)清揚(yáng)

router/index.js

routes: [{
    path: '/helloworld',
    component: resolve => require(['@/components/HelloWorld'], resolve)
  }, {
    path: '/firstcomponent',
    name: 'notFound',
    component: resolve => require(['@/components/firstcomponent'], resolve)
  }

建議你先看下vue-router的文檔吧。。。。這是很基礎(chǔ)的問(wèn)題

2017年9月19日 04:12