Browse Source

Merge pull request #2438 in DEC/fineui from master to feature/x

* commit 'd0384c438fa72bb240d74c0778c80082c408e259':
  无JIRA任务 路由支持history模式 (默认为hash模式)
es6
superman 3 years ago
parent
commit
8c81596c6a
  1. 1
      src/router/router.js
  2. 6
      webpack/webpack.dev.js

1
src/router/router.js

@ -3126,6 +3126,7 @@
BI.RouterWidget = BI.inherit(BI.Widget, { BI.RouterWidget = BI.inherit(BI.Widget, {
init: function () { init: function () {
this.$router = this._router = BI.Router.$router = $router = new VueRouter({ this.$router = this._router = BI.Router.$router = $router = new VueRouter({
mode: this.options.mode,
routes: this.options.routes routes: this.options.routes
}); });
this.$router.beforeEach(function (to, from, next) { this.$router.beforeEach(function (to, from, next) {

6
webpack/webpack.dev.js

@ -36,11 +36,17 @@ module.exports = merge(common, {
output: { output: {
path: dirs.DEST, path: dirs.DEST,
filename: "[name].js", filename: "[name].js",
publicPath: '/',
}, },
devServer: { devServer: {
contentBase: path.join(__dirname, ".."), contentBase: path.join(__dirname, ".."),
port: 9001, port: 9001,
liveReload: true, liveReload: true,
historyApiFallback: {
rewrites: [
{ from: /.*/, to: '/index.html' },
],
},
}, },
plugins: [ plugins: [
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({

Loading…
Cancel
Save