-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
577 additions
and
584 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
/src | ||
|
||
# local env files | ||
.env.local | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,13 @@ | ||
# 多入口文件 | ||
# 多入口多页面功能 | ||
多入口文件,主要用于多页构建。 | ||
|
||
但本脚手架中的入口文件不仅仅是多页构建,还包括动态多入口。 | ||
|
||
脚手架的入口主要有三个: | ||
- 主入口 | ||
- 自定义入口 | ||
- 单页入口 | ||
|
||
参考: | ||
``` | ||
example/sample/entries/sample.js | ||
example/sample/single/sample/entry.js | ||
``` | ||
本脚手架中的入口文件不仅仅是多页构建,还包括动态多入口。 | ||
|
||
注意:多入口需要先开启环境变量 | ||
``` | ||
PAGES_ENABLE=true | ||
``` | ||
|
||
## 主入口 | ||
文件: | ||
``` | ||
src/main.js | ||
``` | ||
路由: | ||
``` | ||
/ | ||
``` | ||
|
||
## 自定义入口 | ||
文件: | ||
``` | ||
src/entries/*.js | ||
``` | ||
路由: | ||
``` | ||
/html-page/* | ||
``` | ||
|
||
## 单页入口 | ||
文件: | ||
``` | ||
src/single/*/entry.js | ||
``` | ||
路由: | ||
``` | ||
/html-single/* | ||
``` | ||
脚手架的入口参考: | ||
- 主入口:参考 `src/main.js` 文件 | ||
- 自定义入口:参考 `example/multiple-entry/page.options.js` 文件 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,12 @@ | ||
# 多路由文件 | ||
# 多路由文件功能 | ||
|
||
多路由功能可以完全的自定义路由,定义的路由放在 `src/router` 目录即可。 | ||
多路由功能可以完全的自定义路由,只需要先引入 `modules/utils/router.js` 文件即可。 | ||
|
||
定义的文件名命名规范为:`*.router.js` | ||
|
||
返回的数据要求是一个路由列表,参考: | ||
``` | ||
example/sample/router/sample.router.js | ||
modules/router/pages.router.js | ||
modules/router/single.router.js | ||
modules/router/testing.router.js | ||
example/multiple-router/pages.router.js | ||
example/multiple-router/single.router.js | ||
example/multiple-router/testing.router.js | ||
``` | ||
|
||
## 公有路由说明 | ||
|
||
### pages.router.js | ||
定义了 `src/pages/{name}.vue` 的所有路由。 | ||
|
||
路由访问:`/page/{name}` | ||
|
||
### single.router.js | ||
定义了 `src/single/*/index.vue` 的所有路由。 | ||
|
||
路由访问:`/single/{name}` | ||
|
||
### testing.router.js | ||
定义了 `src/**/testing.vue` 的所有路由。 | ||
|
||
路由访问:`/testing/{name}` | ||
|
||
这个路由用于写组件的测试文件。 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
'multiple-entry-page1': { | ||
entry: 'src/multiple-entry/page1.entry.js', | ||
title: '测试多入口一', | ||
}, | ||
'multiple-entry-page2': { | ||
entry: 'src/multiple-entry/page2.entry.js', | ||
title: '测试多入口二', | ||
}, | ||
}; |
6 changes: 4 additions & 2 deletions
6
example/sample/single/sample/entry.js → example/multiple-entry/page1.entry.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import Vue from 'vue' | ||
import App from './index.vue' | ||
import App from './page1.vue' | ||
|
||
Vue.config.productionTip = false; | ||
|
||
new Vue({ | ||
let app = new Vue({ | ||
render: h => h(App), | ||
}).$mount('#app'); | ||
|
||
window.app = app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<div>MultipleEntryPage1</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Vue from 'vue' | ||
import App from './page2.vue' | ||
|
||
Vue.config.productionTip = false; | ||
|
||
let app = new Vue({ | ||
render: h => h(App), | ||
}).$mount('#app'); | ||
|
||
window.app = app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<div>MultipleEntryPage2</div> | ||
</template> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.dev { | ||
.development { | ||
.layout.block { | ||
background-color: red; | ||
|
||
|
Oops, something went wrong.