3 ms·
you can do exactly that, they just wanted to showcase the methods option. often you would switch true to false doing: `@click="isSomething = !isSomething"`
by aliveupstairs 7y ago
you can do exactly that, they just wanted to showcase the methods option.
often you would switch true to false doing:
`@click="isSomething = !isSomething"`
- cooperadymas 7y agoExactly this. Template directives support a lot of JS functionality (while not encouraging it, like JSX does). That said, except in rare, extremely simple cases I still prefer wrapping that logic in a computed property or method, as it will inevitably grow more complex later.