1 Star 0 Fork 0

animalcoder/Vue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.js 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
animalcoder 提交于 2020-03-17 14:52 +08:00 . Vueinit
import Vue from 'vue'
import App from './App.vue'
import HelloWorld from '@/components/HelloWorld'
import Hecopy from '@/components/Hecopy'
import ElementUI from "element-ui"
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
import Test from '@/components/Test'
import Son1 from '@/components/Son1'
import Son2 from '@/components/Son2'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{path: '/',component: HelloWorld},
{
path: '/Hellocopy',
name: 'Hellocopy',
component: Hecopy,
children: [
{
path: 'Son1',
name: 'Son1',
component:Son1
},
{
path: 'Son2',
name: 'Son2',
component:Son2
}
]
},
{
path: '/Test',
name: 'Test',
component:Test
}
]
const router = new VueRouter ({
routes,
//mode: 'history' //发布时把这个删掉
})
Vue.config.productionTip = false
new Vue({
el: '#app',
router,
render: h => h(App),
}).$mount('#app')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/animalcoder/Vue.git
git@gitee.com:animalcoder/Vue.git
animalcoder
Vue
Vue
master

搜索帮助