This commit is contained in:
pplokijuhyg 2019-11-25 08:43:09 +08:00
parent 881d56c63e
commit 6dd1b2e31e
5 changed files with 26 additions and 14 deletions

View File

@ -9,7 +9,8 @@
},
"dependencies": {
"core-js": "^3.3.2",
"vue": "^2.6.10"
"vue": "^2.6.10",
"vue-router": "^3.1.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.0.0",

View File

@ -1,28 +1,18 @@
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
<router-view></router-view>
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
export default {
name: 'app',
components: {
HelloWorld
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>

View File

@ -1,8 +1,9 @@
import Vue from 'vue'
import App from './App.vue'
import router from "./router"
Vue.config.productionTip = false
new Vue({
render: h => h(App),
router
}).$mount('#app')

15
src/router.js Normal file
View File

@ -0,0 +1,15 @@
import Vue from 'vue'
//1.导入路由组件vue-router
import Router from 'vue-router'
//2.调用vue-router
Vue.use(Router)
const router=new Router({
routes: [
// {
// path: '/',
// component: Hello
// }
]
});
export default route;

View File

@ -7938,6 +7938,11 @@ vue-loader@^15.7.0:
vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0"
vue-router@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.1.3.tgz#e6b14fabc0c0ee9fda0e2cbbda74b350e28e412b"
integrity sha512-8iSa4mGNXBjyuSZFCCO4fiKfvzqk+mhL0lnKuGcQtO1eoj8nq3CmbEG8FwK5QqoqwDgsjsf1GDuisDX4cdb/aQ==
vue-style-loader@^4.1.0:
version "4.1.2"
resolved "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8"