Hello amazing community!
I'm facing a small challenge with Vue.js 3. I am having trouble setting up a redirect for any unknown route to "/" in the router.
const routes = [
{
path: "/",
name: "Home",
component: Home,
},
{
path: "*",
redirect: "/",
}
]
The redirect: "/" part seems to be working fine, but when I use path: "*", it does not work as expected. The path "/" works only for domain.com/... I also tried using path: "*" but encountered this error:
"Uncaught Error: Route """ should be "/"."
Could someone please guide me on how to implement a 404 redirect in Vue.js 3?