bokino12
bokino12

Reputation: 349

How to use Laravel blade syntax in Vuejs

How to implement this syntax of Laravel below inside a Vue.js component?

@if(!Auth::guest())
    @if(Auth::user()->id === $post->user->id)
        <a href=#>edit</a>
    @endif
@endif 

Upvotes: 0

Views: 950

Answers (1)

bokino12
bokino12

Reputation: 349

This works now

<example-component :user="{{json_encode(Auth::user())}}"></example-component>

Exemple.vue

<template>
  <p>{{ user.name }}</p>
</template>export default {props : ['user']}

Upvotes: 1

Related Questions