使用vue + webpack,一切正常,但是当转到子路由时,请按F5 webpack或vue更改路径。
实施例
子路线localhost:8080/user/config/
资产路径变为localhost:8080/user/static/css
但不必更改路径资产,并将其保留为localhost:8080/static/css
vue js config:
dev: {
env: require('./dev.env'),
port: 8080,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
// assetsPublicPath: '/',
proxyTable: {},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
}