Closed where-picturesque closed 1 year ago
手动写routes文件或者使用http://doc.ssr-fc.com/docs/features$faq#%E5%8A%A8%E6%80%81%E8%B7%AF%E7%94%B1%E5%89%8D%E7%BC%80
感谢
不支持虚拟路由吗 按照示例配置,访问始终404,想实现的效果,例如已经配置实现访问xxx.com/channel/ID, 想实现的效果,访问xxx.com/channel_ID或访问 xxx.com/channel-ID 达到同样效果
// web/route.ts export const FeRoutes = [ { fetch: async () => await import(/ webpackChunkName: "channel-id-under-fetch" / '@/pages/channel/fetch'), path: '/channel_:id', component: async () => await import(/ webpackChunkName: "channel-id-under" / '@/pages/channel/render$id.vue'), webpackChunkName: 'channel-id-under' }, { fetch: async () => await import(/ webpackChunkName: "channel-id-bar-fetch" / '@/pages/channel/fetch'), path: '/channel-:id', component: async () => await import(/ webpackChunkName: "channel-id-bar" / '@/pages/channel/render$id.vue'), webpackChunkName: 'channel-id-bar' } ]
没有配置服务端router
哦哦 感谢 感谢 可以了
详细描述你的问题
项目前端页面级组件目录是/web/pages/mobile;/web/pages/pc
原项目对应的访问路径是 /mobile/xx;/xx
期望的结果
不想给访问地址增加‘/pc’前缀,怎么处理可以使非/mobile开头的路径,渲染/pc文件夹下对应的页面,同时保证服务端渲染正常;类似next.js里 next.config.js rewrites的功能