我有一个使用路由器 View 调用 Vue 页面的 Laravel Blade 页面。我在 Vue 页面上有一个“测试” Prop ,但该页面没有收到该 Prop 。
const routes = [
{path: '/:test', component: MainPageIndex, name: 'mainPageIndex', props: true}
];
Blade页面上的代码是:
<router-view name="mainPageIndex" :test="Test message"> </router-view>
<router-view :test="Test message"> </router-view>
最佳答案
有两种类型的属性:静态和动态。
- static: test="some message"(用于静态值)
- dynamic: v-bind:test="variable"(用于计算值或对象等)
在你的情况下,你应该使用静态的
test="some message"
关于laravel - 使用 router-view 和 Vue 传递 prop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50733285/