Closed
Description
Version
2.5.3
Reproduction link
https://codesandbox.io/s/6zvmx5lorr
Example
import Vue from "vue";
import Router from "vue-router";
import Home from "../src/views/Home.vue";
import Products from "../src/views/Products.vue";
Vue.use(Router);
const routes = [
{ name: "home", path: "/", component: Home },
{
name: "products",
path: "products", // <-- the problem is here
component: Products
}
];
export default new Router({
routes
});
Steps to reproduce
- Open the reproduction
- Click on the products link
What is expected?
I spent some time trying to understand what the problem was, so it would be nice to see a warning message telling that the route is invalid because doesn't have the initial slash.
What is actually happening?
The router goes to a route that doesn't exist.