0
我在我的Vue Webpack Cli项目中使用prerender-spa-plugin。像从文档我正在注册的插件在webpack.prod.conf.js这样在Vue Webpack Cli中获取通过axios的路由列表
...
plugins: [
...
new PrerenderSpaPlugin(
path.join(__dirname, '../dist'),
['/', '/about', '/contact'],
{
captureAfterTime: 5000
}
)
]
我想知道是否有可能通过爱可信调用来获取路线数组列表。 我尝试没有成功如下:
var routes = axios.get('http://myapi.com/api').then(function (response) {
return response.map(function (response) {
return '/base/' + response.slug
})
})
plugins: [
...
new PrerenderSpaPlugin(
path.join(__dirname, '../dist'),
routes,
{
captureAfterTime: 5000
}
)
]
由于我的JavaScript知识贫乏,我不能够解决这个问题。谢谢任何提示。
问候