javascript - Replace vuejs variables with blade if vuejs variables is empty -
i'm using laravel blade vue js in same view. test if vueobject exists display vue js tag, if not display bladearray blade template tag below :
<p v-if="vueobject"> @{{ vueobject.firstname }} </p> <p v-if="!vueobject"> {{ $bladearray['firstname'] }} </p> <p v-if="vueobject"> @{{ vueobject.lastname }} </p> <p v-if="!vueobject"> {{ $bladearray['lastname'] }} </p> <p v-if="vueobject"> @{{ vueobject.email }} </p> <p v-if="!vueobject"> {{ $bladearray['email'] }} </p> <p v-if="vueobject"> @{{ vueobject.phone }} </p> <p v-if="!vueobject"> {{ $bladearray['phone'] }} </p> .........
i have 30 vars (firstname, lastname.....). issue it's make conditions code above. there better solution that?
Comments
Post a Comment