Open yzqdev opened 7 months ago
/hello.html
/hello.html
It works for extra page, thank you.
2.0.0-rc.2
)I just downgrade vuepress to 2.0.0-rc.2
the function router.addRoute
to add a route works.
while update to 2.0.0-rc3
the added route is not found
client.ts
export default defineClientConfig({
enhance({ app, router, siteData }) {
app.component("Hello", Hello);
router.addRoute({
path: "/hi",
name: "hi",
component: Hello,
});
},
});
the router.addRoute
added page (vuepress version 2.0.0-rc.2)
https://yzqbugs.github.io/vuepress-bugs/hi
the #1447 custom routes pr seems to break common usage
2.0.0-rc3
)click the to hi page
button , /hi
not found
Again, /hi.html
, if you need these clean urls, then you must override resolveRoutePath to pervent it being normalized to /hi.html
cc @meteorlxy Maybe we should add extra check with a clean URL edition when the original route path not found.
Description
use extra page or client config to define a route not working
use extra pages
https://v2.vuepress.vuejs.org/advanced/cookbook/adding-extra-pages.html
use plugin api to create a extra page
/hello
, and it's not found when in dev and production helloPlugins.tsregister in
config.ts
A /hello route is expected, but it is 404 link reproduction repo repo
use vue-router
https://v2.vuepress.vuejs.org/advanced/cookbook/usage-of-client-config.html use client config to add a route this
client.ts
fileHello.vue
additional info
I see the
.vuepress/.temp/pages
folder has ahello.html.vue
file, it's content is very well ,while in/hello
route ,it's not found.I remembered when vuepress was beta ,the second solution works well.
Reproduction
https://github.com/yzqbugs/vuepress-bugs
Used Package Manager
yarn
System Info