Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.8k views
in Technique[技术] by (71.8m points)

.html多页页面引入vue.js怎么开发?

之前一直用vue-cli脚手架开发单页面,现在有个多页面任务,愚弟有点不明白怎么开发。

login.html
index.html
about.html
newList.html
detail.html

像这种多页面来回跳的,难道每个文件都得引vue.js,每个都得实例化一次vue吗,像这样的vuex什么的可以用吗


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

多页面的话,每个页面都是独立且完整的环境,所以都要引入并实例化全部框架代码。如果不想这样做就要用 vue-router 这样的库实现单页应用。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...