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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -