0
Good morning/afternoon / evening
I have a doubt, I have a project where I have a dynamic class with ternary operators, I need to add another dynamic class to bring an extra class in this whole joke, but return always gives me an error of "syntax error" I can’t make it work because I don’t understand how to bind this operator correctly.
<div :class=" edit ? 'card-servico servico-valor servico-edit' : 'card-servico'" v-show="!tour || ei === 0">
EDIT:
The idea is to add a new dynamic class, in case without interfering with the operation being done on Edit.
data(){
return {
servicoPagante: {
'pudim': true
},
}
}
<div v-on:click="edit ? :class=" edit ? 'card-servico servico-valor servico-edit' : 'card-servico', 'servicoPagante' :true " v-show="!tour || ei === 0">
but adding Servicopagante there, it gives me syntax error because prior to it is rolling an operation with ternary that is correct but precise add plus this class for another validation
Which classes you want to associate?
– LeAndrade
I wanted to use this service dynamically, but it does not roll because of the previous suit that is rolling
– leonardo silva
Then vc has 3 sets of classes: 1 - card-service-value service-Edit, 2 - card-service and 3 - servicoPagant, Do you want to make the condition so that it is what? Okay confused.
– LeAndrade
Apart from servicePagant, the others work, I want to make servicePagant work without interfering with the previous ones, it would be the new class but it does not work due to the suit. I don’t think I know how to add it without interfering with the previous ones
– leonardo silva