Alejandro Muñoz Alejandro Muñoz - 4 months ago 34
PHP Question

Laravel,blade, vue.js and @if (@{{ }})

I am having a problem with variables devielve vue.js me ... I explain better


@if(@{{}} != 1) // this is the error


I can not define a @if (@ {{ in laravel

before defined

@foreach($datos as $dato)
<tbody id={{$dato->id}}>
@if($dato->id !=1)
@endif >

and it worked but I had to put a select box, and Use varaible vue.js to collect and return the data I...

excuse my English is not my mother tongue and hinders me


I do not believe you can use vuejs code (such as your @{{}}) inside a laravel @if() because everything inside the @if() is being treated as PHP code. If it makes sense in your particular application, make use of vuejs's v-if implementation, such as <div v-if=" !== 1"> INSERT WHATEVER HERE </div>