S M*_*han 5 vue.js vue-router vue-component vuex
我在 vue 中有一个应用程序并注册了路由器,我需要的只是通过 .
应用程序.vue
<template>
<v-app>
<router-view :user="userVariable"></router-view>
</v-app>
</template>
Run Code Online (Sandbox Code Playgroud)
路由器.js
Vue.use(Router);
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: [
{
path: '/login',
name: 'Login',
component: Login,
props: true,
},
{
path: '/profile',
name: 'profile',
component: Profile,
props: true,
},
],
});
Run Code Online (Sandbox Code Playgroud)
我在启动组件时获得了道具,但在更新值时无法获得更新的道具userVariable。:(
| 归档时间: |
|
| 查看次数: |
5341 次 |
| 最近记录: |