From 093c169f2774a00c54dee254a5e07f3c4c89f49b Mon Sep 17 00:00:00 2001 From: guilixie <597634713@qq.com> Date: Sat, 26 Jan 2019 19:55:09 +0800 Subject: [PATCH 1/3] create single page app demo --- build/utils.js | 2 +- public/admin.html | 19 -------- public/index.html | 2 +- src/{views/admin => }/App.vue | 13 +----- src/components/Hello.vue | 22 --------- src/{views/admin => }/main.js | 0 src/views/admin/components/ImgShow.vue | 18 -------- src/views/index/App.vue | 57 ------------------------ src/views/index/components/TableShow.vue | 51 --------------------- src/views/index/main.js | 13 ------ vue.config.js | 22 --------- 11 files changed, 4 insertions(+), 215 deletions(-) delete mode 100644 public/admin.html rename src/{views/admin => }/App.vue (63%) rename src/{views/admin => }/main.js (100%) delete mode 100644 src/views/admin/components/ImgShow.vue delete mode 100644 src/views/index/App.vue delete mode 100644 src/views/index/components/TableShow.vue delete mode 100644 src/views/index/main.js delete mode 100644 vue.config.js diff --git a/build/utils.js b/build/utils.js index 56092db..d68ef56 100644 --- a/build/utils.js +++ b/build/utils.js @@ -12,7 +12,7 @@ const defaultOpt = { template: './public/index.html', filename: 'index.html', favicon: './public/favicon.ico', - chunks: ['manifest', 'vendor', 'admin'] + chunks: ['manifest', 'vendor', 'app'] } } diff --git a/public/admin.html b/public/admin.html deleted file mode 100644 index 6530bde..0000000 --- a/public/admin.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - <%= htmlWebpackPlugin.options.title %> - - - - -
- - - - diff --git a/public/index.html b/public/index.html index 6530bde..f458e92 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ - <%= htmlWebpackPlugin.options.title %> +hello-world diff --git a/src/views/admin/App.vue b/src/App.vue similarity index 63% rename from src/views/admin/App.vue rename to src/App.vue index 726f521..270403e 100644 --- a/src/views/admin/App.vue +++ b/src/App.vue @@ -1,25 +1,16 @@ diff --git a/src/components/Hello.vue b/src/components/Hello.vue index b555b94..e639ba0 100644 --- a/src/components/Hello.vue +++ b/src/components/Hello.vue @@ -3,16 +3,6 @@

Hello, {{ name }}

{{ msg }}

Project examples

- @@ -24,18 +14,6 @@ export default { return { msg: 'Welcome to Your Vue.js App' } - }, - computed: { - routeConfig () { - const map = { - admin: 'index', - index: 'admin' - } - return { - url: `/${map[this.name]}.html`, - label: `跳转到${map[this.name]}` - } - } } } diff --git a/src/views/admin/main.js b/src/main.js similarity index 100% rename from src/views/admin/main.js rename to src/main.js diff --git a/src/views/admin/components/ImgShow.vue b/src/views/admin/components/ImgShow.vue deleted file mode 100644 index 093da3e..0000000 --- a/src/views/admin/components/ImgShow.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/src/views/index/App.vue b/src/views/index/App.vue deleted file mode 100644 index 3037332..0000000 --- a/src/views/index/App.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/views/index/components/TableShow.vue b/src/views/index/components/TableShow.vue deleted file mode 100644 index b9fe59b..0000000 --- a/src/views/index/components/TableShow.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - diff --git a/src/views/index/main.js b/src/views/index/main.js deleted file mode 100644 index 684ffac..0000000 --- a/src/views/index/main.js +++ /dev/null @@ -1,13 +0,0 @@ -// The Vue build version to load with the `import` command -// (runtime-only or standalone) has been set in webpack.base.conf with an alias. -import Vue from 'vue' -import App from './App' - -Vue.config.productionTip = false - -/* eslint-disable no-new */ -new Vue({ - el: '#app', - components: { App }, - template: '' -}) diff --git a/vue.config.js b/vue.config.js deleted file mode 100644 index 05fac5a..0000000 --- a/vue.config.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' - -module.exports = { - pages: { - index: { - entry: './src/views/index/main.js', - template: './public/index.html', - filename: 'index.html', - favicon: './public/favicon.ico', - title: '主页', - chunks: ['manifest', 'vendor', 'index'] - }, - admin: { - entry: './src/views/admin/main.js', - template: './public/admin.html', - filename: 'admin.html', - favicon: './public/favicon.ico', - title: '后台管理', - chunks: ['manifest', 'vendor', 'admin'] - } - } -} From c66d16bf117dfa10c653794cbe1f7524cbdb061b Mon Sep 17 00:00:00 2001 From: guilixie <597634713@qq.com> Date: Tue, 29 Jan 2019 16:00:08 +0800 Subject: [PATCH 2/3] Update Hello.vue --- src/components/Hello.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Hello.vue b/src/components/Hello.vue index e639ba0..cec7cbe 100644 --- a/src/components/Hello.vue +++ b/src/components/Hello.vue @@ -2,7 +2,6 @@

Hello, {{ name }}

{{ msg }}

-

Project examples

From 6f154899a0242fea8769f1a124ec3e80aab426ae Mon Sep 17 00:00:00 2001 From: guilixie <597634713@qq.com> Date: Sat, 23 Feb 2019 20:37:13 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 176eaed..42d46ab 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,11 @@ const htmlPluginOpt = { } const pageConfig = getVueConfig() + +function getEntries () { + return pageConfig.entries +} + function setMultipagePlugin (mode = process.env.NODE_ENV) { const webpackConfig = { plugins: []