惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
月光博客
月光博客
Y
Y Combinator Blog
量子位
J
Java Code Geeks
The GitHub Blog
The GitHub Blog
MyScale Blog
MyScale Blog
aimingoo的专栏
aimingoo的专栏
Microsoft Azure Blog
Microsoft Azure Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
罗磊的独立博客
Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
S
Schneier on Security
S
Security Affairs
Project Zero
Project Zero
L
LINUX DO - 热门话题
H
Hacker News: Front Page
Google Online Security Blog
Google Online Security Blog
L
Lohrmann on Cybersecurity
Latest news
Latest news
P
Palo Alto Networks Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
The Last Watchdog
The Last Watchdog
Help Net Security
Help Net Security
I
Intezer
The Register - Security
The Register - Security
小众软件
小众软件
C
Check Point Blog
NISL@THU
NISL@THU
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tor Project blog
D
Docker
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
Forbes - Security
Forbes - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Security Latest
Security Latest
博客园 - 司徒正美
IT之家
IT之家

Jay Zangwill

前端该如何选择图片的格式 移动端适配 扒一扒浏览器缓存机制 line-height和vertical-align采坑记 分享个人前端学习路线及面试经验 搜狗实习总结 记一次我看红宝书对继承加深的理解 四月北京面试之旅 常用的mongodb命令 几个让我印象深刻的面试题(二) 几个让我印象深刻的面试题(一) css盒模型与定位 javscript的数据类型 angular学习笔记(3) angular学习笔记(2) angular学习笔记(1) 初尝vue sass基础 hexo+github快速搭建个人博客
vue-cli-multipage
Jay Zangwill · 2018-03-06 · via Jay Zangwill

基于vue-cli的多页面应用脚手架

前言

原文

掘金

知乎&知乎专栏

目前vue-cli生成的配置都是做多页面的,然而,我们有时也会有多页面的需求。
同时,之前借用的这个多页面例子貌似作者不再维护了,导致webpack升级到webpack2就无法使用了,所以我就参考这个例子自己弄了个多页面脚手架,会不定期维护的。

代码地址:https://github.com/JayZangwill/vue-multipage
有什么问题可以在issues上提,欢迎star

下载&使用

1
2
3
4
5
6
7
8
9
git clone https://github.com/JayZangwill/vue-multipage
cd vue-multipage
npm i

//开发模式(运行完后要在浏览器输入http://localhost:8081/module/index)
npm run dev

//生产模式
npmrun build

目录结构

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
vue-multipage
|---build
|---config
|---src
|---assets
|---components 组件
|---HelloWorld.vue
|---other.vue
|---module多页面模块
|---index
|---index.html
|---index.js
|---App.vue
|---other
|---index.html
|---other.js
|---App.vue

说明

如需添加页面需要在module目录下新建文件夹,然后文件夹里必须包括.hmtl,.js,.vue文件作为入口文件。

运行npm run dev命令后,需要在浏览器输入http://localhost:8081/module/+module下目录文件夹名/+文件夹名里的html文件

已知bug

  1. 目前公用css还无法分离
  2. 开发模式需要手动输入url打开页面,不能直接打开。

同时也欢迎提代码pull来帮助我解决bug

参考

vue-cli + webpack 多页面实例应用