Answer the question
In order to leave comments, you need to log in
How to hang dynamic style?
Guys, how to hang the style correctly? To the active "tab" or component ?
p ( class="modalCreate__body-item" @click="switchView('modalCreateTemplate')" :class="{'switch': currentView}") Выбрать шаблон
p ( class="modalCreate__body-item" @click="switchView('modalCreateContacts')" :class="{'switch': currentView}") Контакт
// это переключение между компонентами
p ( class="modalCreate__body-item" @click="switchView('modalCreateContractors')") Контрагент
component(:is="currentView") // вывод выбраного компонента
components: {
modalCreateTemplate,
modalCreateContacts,
modalCreateContractors
},
methods: {
switchView (view) {
this.currentView = view
}
}
p(class="modalCreate__body-item" @click="switchView('modalCreateTemplate')" :class="{'switch': switched}") Выбрать шаблон
data {
switched: false,
},
methods: {
switchView (view) {
this.currentView = view
this.switched = true
}
}
Answer the question
In order to leave comments, you need to log in
p ( class="modalCreate__body-item" @click="switchView('modalCreateTemplate')" :class="{'switch': currentView === 'modalCreateTemplate'}") Выбрать шаблон
Контрагент
?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question