0👍
I did it in a wrong way, maybe it will work.
I get a different solution:
Instead of using data in components, i’m using “props”.
I don’t need to import, just called the props in the blade template of laravel, there i can use @elements from laravel.
Props in component:
props:{
usuario:String
},
Now i’m using that:
@extends('layouts.app')
@section('content')
<user-component usuario="{{ Auth::user()->name }}"></user-component>
@endsection
Works well, if you need more data u can add a function in the Model.
Now i can use that in my template of component
<template>
<tr v-if="{{usuario}} =='Admin'">
- [Vuejs]-Manipulating data on parent with $event or via $parent in Vue.js
- [Vuejs]-Unable to find robots.txt file
Source:stackexchange.com