In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is the method of configuring multi-pages in vue-cli 3.x", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the method of configuring multiple pages in vue-cli 3.x"?
1. First of all, if we have vue cil2 on our system, we need to uninstall it and then reinstall vue cil3. After the installation and configuration is complete, we will create a corresponding page and file.
When creating multiple pages, we need to create a login.html file under the index.html statistics file, and then create the corresponding login.js and login.vue in the src/pages/login folder (we can modify it through the App.vue and main.js in the file. )
Login.js file import Vue from 'vue'import Login from'. / login.vue'Vue.config.productionTip = falsenew Vue ({render: h = > h (Login)}). $mount ('# login') login.vue file export default {name:'login', methods: {go () {_ window.location.href= "/"}
two。 Configure the vue.config.js file.
When we download the update, the build and config files in the initialization project will be gone, so if we want to configure webpack-related content, we need to create a vue.config.js file in the root directory (at the same level as package.json). If the file exists, it will be automatically loaded by @ vue/cli-service. There are the following parameters: entry, template, filename, title, chunks, all of which can be selected except entry. The code is as follows:
Vue.config.js file module.exports = {pages: {index: {/ / page entry entry:'src/main.js', / / template source template:'public/index.html', / / output filename:'index.html', in dist/index.html / / when using the title option The title tags in / / template need to be generic chunk and vendor chunk extracted by title:'index', / /. / / chunks: ["chunk-vendors", "chunk-common", "index"]}, login: {entry:'src/pages/login/login.js', template:'public/login.html', filename:'login.html', title:'login'}} so far I believe you have a deeper understanding of "what is the method of configuring multi-pages in vue-cli 3.x", so you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
This article is about how JavaScript displays the date and time of a personal client machine. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look. Displays the date and time of the personal client machine
Wechat
About us
Contact us
Product review
car news
thenatureplanet
More Form oMedia:
AutoTimes.
Bestcoffee.
SL News.
Jarebook.
Coffee Hunters.
Sundaily.
Modezone.
NNB.
Coffee.
Game News.
FrontStreet.
GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.