unable to pass data from laravel 9 blade to vue 3 components
when I tried in Vue 2 It worked but Vue 3 not working. Please help me.
My code
Vue
The quick brown fox...
<div class="inline-flex justify-between w-full">
<h1>{{ nodeGroups }} Hi</h1>
</div>
export default{
props:['nodeGroups'],
mounted () {
// Do something useful with the data in the template
console.dir(this.nodeGroups)
}
}
app.js
import { createApp } from "vue";
import Welcome from "./components/test.vue";
createApp(Welcome).mount("#app");
Laravel blade
{{-- --}}
where did you pass your data? Didn't see any
@MaverickChan Sorry I may not post nicely. I passed from blade to vue
blade:
<Welcome :nodeGroups="{{json_encode($company)}}"></Welcome>
</div>
vue:
The quick brown fox...
<div class="inline-flex justify-between w-full">
<h1>{{ nodeGroups }} Hi</h1>
</div>
export default{
props:['nodeGroups'],
mounted () {
console.dir(this.nodeGroups)
}
}
import { createApp } from "vue";
import Welcome from "./components/test.vue";
createApp(Welcome).mount("#app");
<div class="inline-flex justify-between w-full">
<h1>{{ nodeGroups }}</h1>
</div>
export default{
props:['nodeGroups']
}
public function show(SubscriptionAction $action)
{
$company = $action->getCompanyData();
return view('subscription.subscription_group', compact('company'));
}
<Welcome :nodeGroups="'{{json_encode($company)}}'"></Welcome>
Please or to participate in this conversation.