Showing
5 changed files
with
35 additions
and
5 deletions
@@ -7,11 +7,13 @@ import Util from './libs/util'; | @@ -7,11 +7,13 @@ import Util from './libs/util'; | ||
7 | import App from './app.vue'; | 7 | import App from './app.vue'; |
8 | import 'iview/dist/styles/iview.css'; | 8 | import 'iview/dist/styles/iview.css'; |
9 | 9 | ||
10 | +import bus from './plugin/bus' | ||
10 | 11 | ||
11 | Vue.use(VueRouter); | 12 | Vue.use(VueRouter); |
12 | 13 | ||
13 | 14 | ||
14 | Vue.use(iView); | 15 | Vue.use(iView); |
16 | +Vue.use(bus); | ||
15 | 17 | ||
16 | // 路由配置 | 18 | // 路由配置 |
17 | const RouterConfig = { | 19 | const RouterConfig = { |
src/plugin/bus.js
0 → 100644
@@ -3,17 +3,22 @@ const routers = [{ | @@ -3,17 +3,22 @@ const routers = [{ | ||
3 | component: (resolve) => require(['./views/layout.vue'], resolve), | 3 | component: (resolve) => require(['./views/layout.vue'], resolve), |
4 | children: [ | 4 | children: [ |
5 | { | 5 | { |
6 | - path: 'similar', | 6 | + path: 'index.html', |
7 | + name: 'similar.index', | ||
8 | + component: (resolve) => require(['./views/similar/list'], resolve) | ||
9 | + }, | ||
10 | + { | ||
11 | + path: 'similar.html', | ||
7 | name: 'similar.list', | 12 | name: 'similar.list', |
8 | component: (resolve) => require(['./views/similar/list'], resolve) | 13 | component: (resolve) => require(['./views/similar/list'], resolve) |
9 | }, | 14 | }, |
10 | { | 15 | { |
11 | - path: 'image', | 16 | + path: 'image.html', |
12 | name: 'image.list', | 17 | name: 'image.list', |
13 | component: (resolve) => require(['./views/image/list'], resolve) | 18 | component: (resolve) => require(['./views/image/list'], resolve) |
14 | }, | 19 | }, |
15 | { | 20 | { |
16 | - path: 'image', | 21 | + path: 'image.html', |
17 | name: 'image.edit', | 22 | name: 'image.edit', |
18 | component: (resolve) => require(['./views/image/editor'], resolve) | 23 | component: (resolve) => require(['./views/image/editor'], resolve) |
19 | }, | 24 | }, |
@@ -77,7 +77,14 @@ | @@ -77,7 +77,14 @@ | ||
77 | }, | 77 | }, |
78 | goTop() { | 78 | goTop() { |
79 | this.$refs.backtop.back() | 79 | this.$refs.backtop.back() |
80 | + }, | ||
81 | + goNext() { | ||
82 | + this.$bus.emit('gonext') | ||
83 | + }, | ||
84 | + goBack() { | ||
85 | + this.$bus.emit('goback') | ||
80 | } | 86 | } |
87 | + | ||
81 | } | 88 | } |
82 | } | 89 | } |
83 | </script> | 90 | </script> |
@@ -13,7 +13,7 @@ fs.open('./src/config/env.js', 'w', function (err, fd) { | @@ -13,7 +13,7 @@ fs.open('./src/config/env.js', 'w', function (err, fd) { | ||
13 | module.exports = merge(webpackBaseConfig, { | 13 | module.exports = merge(webpackBaseConfig, { |
14 | devtool: '#source-map', | 14 | devtool: '#source-map', |
15 | output: { | 15 | output: { |
16 | - publicPath: '/dist/', | 16 | + publicPath: '/dist', |
17 | filename: '[name].js', | 17 | filename: '[name].js', |
18 | chunkFilename: '[name].chunk.js' | 18 | chunkFilename: '[name].chunk.js' |
19 | }, | 19 | }, |
@@ -37,6 +37,9 @@ module.exports = merge(webpackBaseConfig, { | @@ -37,6 +37,9 @@ module.exports = merge(webpackBaseConfig, { | ||
37 | '/api': 'http://localhost:8080' | 37 | '/api': 'http://localhost:8080' |
38 | }, | 38 | }, |
39 | port: 8000, | 39 | port: 8000, |
40 | - host: '0.0.0.0' | 40 | + historyApiFallback: { |
41 | + index: 'index.html', | ||
42 | + logger: console.log.bind(console) | ||
43 | + } | ||
41 | } | 44 | } |
42 | }); | 45 | }); |
-
Please register or login to post a comment