How does vue set up the page you enter at the beginning
This article mainly introduces the vue how to set up the page entered at the beginning of the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, with a certain reference value, I believe that everyone after reading this vue how to set up the beginning of the page article will have a harvest, let's take a look at it.
The default page entered by the vue project is
HelloWorld.vue
Now let's create a page Login.vue
Login interface export default {data () {return {}
In the index.js file under the router directory, we set up the page we entered at the beginning
Initial index.js file:
Import Vue from 'vue'import Router from' vue-router'import HelloWorld from'@ / components/HelloWorld'Vue.use (Router) export default new Router ({routes: [{path:'/', name: 'HelloWorld', component: HelloWorld}]})
Now let's get him to the login page Login.vue at the beginning.
Import Vue from 'vue'import Router from' vue-router'import Login from'@ / components/Login'Vue.use (Router) export default new Router ({routes: [{path:'/', name: 'Login', component: Login}]})
After running:
This is the end of the article on "how to set up the page you entered at the beginning of vue". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to set up the page to enter at the beginning of vue". If you want to learn more, you are welcome to follow the industry information channel.