Problem description: Experimental results and discussion: 1. Create a vue-cli default project (containing only babel)2. Enter the creation file
3. Check the configuration
4. Create views folder
5. Set up APP.vueSet up as follows: <template> <div id="app"> <div id="nav"> <router-link to="/">home</router-link> | <router-link to="/about">about</router-link> </div> <router-view/> </div> </template> <style> #app { text-align: center; margin-top: 60px; } </style> 6. Configure main.jsimport Vue from 'vue' import Router from 'vue-router' import Home from './views/Home.vue' Vue.use(Router) export default new Router({ mode: 'history', base: process.env.BASE_URL, routes: [ { path: '/', name: 'home', component: Home }, { path: '/about', name: 'about', component: () => import( './views/About.vue') } ] }) 7. Operation resultsas follows: Summary of the problem: In this experiment, This is the end of this article about how to implement page jump in vue project. For more relevant content about how to implement page jump in vue project, please search previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: HTML4.0 element default style arrangement
MySQL Bin log data recovery: accidentally delete ...
When writing a web project, I encountered an intr...
Docker is becoming more and more popular. It can ...
Frequently asked questions When you are new to ea...
The purpose of using HTML to mark up content is t...
Database SQL optimization is a common problem. Wh...
In the front-end layout process, it is relatively...
Problems: After adding the -v parameter to docker...
In many cases, large and medium-sized websites wi...
method: Take less in the actual project as an exa...
This article mainly introduces how to use the Rea...
Problem Description In the login page of the proj...
Table of contents Purpose Experimental environmen...
This article shares the specific code for JavaScr...
Table of contents 1. List interface display examp...