文章加密

;

2019年5月19日 星期日

vue router

1. 接續成功的webpack專案建置在安裝vue router,遇到了安裝問題
https://github.com/vuejs/vue-cli/issues/2754\

[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build. #2754





commented 3 days ago




i had the same question , and resolved it ! change your webpack.config.js or App.vue like this :
  1. webpack.config.js
resolve: { alias: { vue: 'vue/dist/vue.esm.js' } }
  1. App.vue
new Vue({ el: '#app', router, render: h => h(App) })


2. 接著看
https://router.vuejs.org/zh/guide/essentials/dynamic-matching.html#%E5%93%8D%E5%BA%94%E8%B7%AF%E7%94%B1%E5%8F%82%E6%95%B0%E7%9A%84%E5%8F%98%E5%8C%96

https://router.vuejs.org/zh/api/#router-link


沒有留言:

張貼留言