xinggevip

Vue2.x Cli3.x router文件抽离
router.jsexport const router = new Router({ mode: 'hist...
扫描右侧二维码阅读全文
27
2019/05

Vue2.x Cli3.x router文件抽离

router.js

export const router = new Router({
  mode: 'history',
  base: process.env.BASE_URL,

  routes:[
    {
      path: '/',
      name: 'home',
      component: Home
    },
})

main.js

import {router} from './router'

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
Last modification:May 28th, 2019 at 09:37 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment