nativescript-vue / nativescript-vue

Native mobile applications using Vue and NativeScript.
https://nativescript-vue.org/
MIT License
5.35k stars 243 forks source link

Nativescript VueJS Button Event #582

Open amitj1509 opened 4 years ago

amitj1509 commented 4 years ago

Version

2.5.0-alpha.2

Reproduction link

https://play.nativescript.org/?template=play-vue&id=l7nBAv&v=6

Platform and OS info

Android and IOS

Steps to reproduce

What is expected?

Button text will be change.

What is actually happening?

Button text is not change.

rigor789 commented 4 years ago

The text "Hello Sweetcode!" gets toggled correctly.

If you expect the button text to change, you need to bind the text of the button like so (for example, there are multiple ways to do this):

<button @tap="toggleHeader()">{{ showTitle ? 'Hide' : 'Show' }}</button>

See updated playground: https://play.nativescript.org/?template=play-vue&id=l7nBAv&v=7