lundi 11 septembre 2017

Replace vuejs variables with blade if vuejs variables is empty

I'm using laravel blade with vue js in the same view. I test if vueObject exists i display it with vue js tag, if not i display bladeArray with blade template tag like below :

<p v-if="vueObject"> @ </p>
<p v-if="!vueObject">  </p>

<p v-if="vueObject"> @ </p>
<p v-if="!vueObject">  </p>

<p v-if="vueObject"> @ </p>
<p v-if="!vueObject">  </p>

<p v-if="vueObject"> @ </p>
<p v-if="!vueObject">  </p>

.........

I have 30 vars (firstname, lastname.....). So my issue is that it's too much to make conditions like the code above. Is there a better solution than that?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire