We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
原项目是基于古老的 Vue CLI 建成的,使用的仍是 webpack 2,构建依赖等问题,项目在构件时出现报错,详细见 #5 。
新版的 Vue CLI 拥有更多的功能,解决了以前没办法实现的问题,与其在原构建方案中修复问题,不如拥抱新构建版本。
现在重新使用 Vue CLI 4 初始化模板,将源代码迁移到模板里,并构建出多页面应用。
The text was updated successfully, but these errors were encountered:
原有的应用入口文件存放在 src/entries 目录中
src/entries
src ├─entries │ admin-main.js │ init.js │ main.js
修改后的入口文件
src ├─pages │ ├─admin │ │ app.js │ │ │ ├─filmy │ │ app.js │ │ │ └─init │ app.js
在新的 Vue CLI 4 创建的项目,配置文件 vue.config.js 通过 page 参数导入多个页面对象,即可构建出多页面应用:
vue.config.js
page
const pageSet = (name, title = "") => { return { [`${name}`] : { entry: `src/pages/${name}/app.js`, template: `public/${name}.html`, filename: `${name}.html`, title: title ? title: name } } } const pages = { ...pageSet('init'), ...pageSet('admin'), ...pageSet('filmy'), } module.exports = { //... pages }
那么在开发项目时,通过下面的地址访问相关页面
http://localhost:8080/init http://localhost:8080/admin http://localhost:8080/filmy
Sorry, something went wrong.
create vue project from vue-cli4, and build multi page app, close #6
8ba73ce
409915016
No branches or pull requests
原项目是基于古老的 Vue CLI 建成的,使用的仍是 webpack 2,构建依赖等问题,项目在构件时出现报错,详细见 #5 。
新版的 Vue CLI 拥有更多的功能,解决了以前没办法实现的问题,与其在原构建方案中修复问题,不如拥抱新构建版本。
现在重新使用 Vue CLI 4 初始化模板,将源代码迁移到模板里,并构建出多页面应用。
The text was updated successfully, but these errors were encountered: