Closed PanosTrak closed 4 years ago
Actually, this part of the docs is incorrect. We'll update it to reflect the correct code.
Essentially, :on-press
and other handlers need to be passed either methods or callbacks.
This should work:
<button :on-press="() => { seen = !seen }">Click to Toggle</button>
A cleaner way might be to create a method toggleSeen
:
<button @press="toggleSeen">Click to Toggle</button>
...
methods: {
toggleSeen() {
this.seen = !this.seen
}
},
I am following the docs and I am on conditional part.
when i paste this into my code i get the error of:
Invariant Violation: The title prop of a Button must be a string
so i wrote a v-bind:title="something" and set that in the data but then i get the error of
console.error: "[Vue warn]: You may have an infinite update loop in a component render function (found in <Anonymous>)"
I do something wrong or the docs are outdated?