javascript - Vue, Mirroring the elements -


there 2 teams, each has logo , name, , first team, display logo, , name, , second, name, , logo. wanted put logo , name in component, , handle situation :

<div class="team_container">     <template v-if="isteam1flag">         <img :src="teamlogosrc" alt="logo team 1">         <span >team 1</span>     </template>     <template v-else>         <span >team 1</span>         <img :src="teamlogosrc" alt="logo team 1">     </template> </div> 

can tell me if there better solution task? in each branch code, in fact, same logic, difference in order of elements.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -