Error in render function: "Typeerror:cannot Read property ' matched ' of undefined"
webpack4.0.1, there are also the following issues (note points):
1, Vuerouter instantiation of the parameters, can be abbreviated to routes, indicating routes:routes. Note, however, that "routes:routes" indicates that the property name is routes and the value is routes. In this case (both the property name and the value are routes), you can abbreviate it. However, do not mistakenly assume that the shorthand routes is the variable name (array name) of the route. If your array name is myroutes, then the correct notation is routes:myroutes.
The following is the correct example:
var myroutes= [
{path: "/", Component:hello},
{path: '/h ', Component:hello},
{path: "/w", Component:world}
];
Const Myroute = new Vuerouter ({
routes:myroutes
});
2, the official web, the instantiation of the Vue object, also used shorthand, such as:
Const APP = new Vue ({
Router
}). $mount (' #app ')
Router is equivalent to: Router:router, also because, like the variable name and the property name, if your route instance name is not router, do not omit it.
As follows:
Import {R} from "./router/index.js";//Routing configuration
The use function must be used for third-party components.
Vue.use (Vuerouter);
New Vue ({
El: "#app",
Router:r,
Render: (h) =>{
Return h (APP)
}
});