Commit 81a60df0 by mamingqun

添加路由,工具类文件夹

parent b05533ea
......@@ -4,8 +4,8 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build-test": "vue-cli-service build --mode stage",
"build-off": "vue-cli-service build",
"build": "vue-cli-service build --mode stage",
"lint": "vue-cli-service lint"
},
"dependencies": {
......
......@@ -2,7 +2,10 @@
<div id="app">
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
<router-link to="/about">About</router-link>|
<router-link to="/index">index</router-link>|
<router-link to="/loading">loading</router-link>|
<router-link to="/user">user</router-link>
</div>
<router-view/>
</div>
......
import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Loading from './views/Loading.vue'
import User from './views/User.vue'
import Detail from './views/Detail.vue'
import Index from './views/Index.vue'
Vue.use(Router)
export default new Router({
routes: [
{
routes: [{
path: '/',
name: 'home',
component: Home
},
{
path: '/loading',
name: 'loading',
component: Loading
},
{
path: '/user',
name: 'user',
component: User
},
{
path: '/detail',
name: 'detail',
component: Detail
},
{
path: '/index',
name: 'index',
component: Index
},
{
path: '/about',
name: 'about',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
component: () => import( /* webpackChunkName: "about" */ './views/About.vue')
}
]
})
})
\ No newline at end of file
<template>
<div>Detail页面</div>
</template>
<script>
export default {
}
</script>
\ No newline at end of file
......@@ -18,9 +18,10 @@ export default {
}
},
mounted() {
this.msg = process.env.VUE_APP_BUILD_TYPE
this.msg = process.env.NODE_ENV
console.log( process.env.NODE_ENV )
console.log(process.env.VUE_APP_BUILD_TYPE);
},
components: {
HelloWorld
......
<template>
<div>Index页面</div>
</template>
<script>
export default {
}
</script>
\ No newline at end of file
<template>
<div>loading页面</div>
</template>
<script>
export default {
}
</script>
<template>
<div>User页面</div>
</template>
<script>
export default {
}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment