[Vuejs]-How to change export const in vue js

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'">

Leave a comment