Skip to content

zhu-meng-han/help-center

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Development

不需要 vue-router 时,只需:

new Vue({
  render: h => h('router-view')
}).$mount(document.querySelector('app'));

使用 vue-router 时,只需:

const router = new VueRouter({
  mode: 'history',
  routes: [
    {path: '/list', component: require('./components/home/index.vue')},
    {path: '/help', component: require('./components/help/index.vue')}
  ]
});

new Vue({
  router,
  render: h => h('router-view')
}).$mount(document.querySelector('app'));

创建一个 routes.js

export default [
  {
    path: '/list',
    component: require('./components/home/index.vue')
  },
  {
    path: '/help',
    component: require('./components/help/index.vue')
  }
];

index.js 文件内:

import routers from './router.js';

const router = new VueRouter({
  mode: 'history',
  routes
});

new Vue({
  router,
  render: h => h('router-view')
}).$mount(document.querySelector('app'));

以下是启动运行:

make install
make dev

访问

http://localhost:8081/

Production

make deploy

License

ISC