vue-skeleton-webpack-plugin icon indicating copy to clipboard operation
vue-skeleton-webpack-plugin copied to clipboard

路由history模式下,不支持路由base

Open LeoZeda opened this issue 5 years ago • 4 comments

路由设置了history模式,并且设置了基准路径,无法显示骨架屏 如: router: { mode: 'history', base: '/test/', routes: [{ path: '/list', skeletonId: 'list-skeleton' }, { path: '/', skeletonId: 'index-skeleton' }] }

看了一下源码是直接拿location.pathname 与path匹配导致匹配不成功,可否增加个base参数, isMatched函数中路径加上base路径后再匹配?

LeoZeda avatar Dec 04 '18 08:12 LeoZeda

请问,能不能提个 PR

PengXing avatar Dec 06 '18 03:12 PengXing

有空再提交一下哈,现在暂时在path写正则,所有正则都加上了base这个前缀,暂时可以解决

LeoZeda avatar Dec 06 '18 08:12 LeoZeda

好,提前感谢

PengXing avatar Dec 06 '18 08:12 PengXing

现在 支持base了么

672064406zerui avatar Aug 28 '19 01:08 672064406zerui