|
@@ -4,6 +4,17 @@ import Home from "./views/Home.vue";
|
|
|
|
|
|
Vue.use(Router);
|
|
Vue.use(Router);
|
|
|
|
|
|
|
|
+// function propsValidator(route, component) {
|
|
|
|
+// const props = { ...route.params };
|
|
|
|
+// Object.entries(props).map(([key, prop]) => {
|
|
|
|
+// console.log(prop, key);
|
|
|
|
+// if (!(prop instanceof component.props[key].type)) {
|
|
|
|
+// props[key] = component.props[key].type(prop);
|
|
|
|
+// }
|
|
|
|
+// });
|
|
|
|
+// return props;
|
|
|
|
+// }
|
|
|
|
+
|
|
let router = new Router({
|
|
let router = new Router({
|
|
mode: "history",
|
|
mode: "history",
|
|
routes: [
|
|
routes: [
|
|
@@ -21,6 +32,13 @@ let router = new Router({
|
|
component: () =>
|
|
component: () =>
|
|
import(/* webpackChunkName: "about" */ "./views/About.vue")
|
|
import(/* webpackChunkName: "about" */ "./views/About.vue")
|
|
}
|
|
}
|
|
|
|
+ // {
|
|
|
|
+ // path: "/xxx/:id",
|
|
|
|
+ // component: XXX,
|
|
|
|
+ // props(route) {
|
|
|
|
+ // return propsValidator(route, XXX);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
]
|
|
]
|
|
});
|
|
});
|
|
|
|
|