2.0.2
https://play.nativescript.org/?template=play-vue&id=o5jFvQ&v=5
ios
The docs say selectedIndex "gets or sets" the current index and its a prop. How do you get the selectedIndex if its a prop? If you do v-model="selectedIndex" I get an object not a int
get current index
either it stays 0 on tab change with :selectedIndex="selectedIndex" orv-model="selectedIndex"` I get an object
The reproduction link does not show the issue you are describing, in fact it doesn't show anything when I run it. The HelloWorld component does not have a template nor a page tag, can you update the reproduction to actually show the issue you are facing?
@rigor789 sorry, in my daze late last night I forgot some stuff. I updated the link. You can see that when the tab is switch the index should be got from 0 to 1 and the text should change, it does not.
Props are one way, from parent to child. Changing it to v-model="selectedIndex" should work.
What v-model does is roughly something like :selectedIndex="selectedIndex" @selectedIndexChange="selectedIndex = $event.value"
Although I just created a test project locally, and v-model doesn't seem to be working. Will look into it. The above way (what v-model should be doing) is how you can do a two way binding.
@rigor789 Ya I understand v-model and how props are one way. I was just pointing out v-model doesnt work on this tabview (returns an object) and the docs make it sound like :selectedIndex prop is a getter too. I would recommend changing the docs to point out using v-model to get the index when it works. Thanks
@rigor789 Just came across this thread now and can confirmv-model not working , but :selectedIndex="selectedIndex" @selectedIndexChange="selectedIndex = $event.value"
Most helpful comment
@rigor789 Just came across this thread now and can confirm
v-modelnot working , but:selectedIndex="selectedIndex" @selectedIndexChange="selectedIndex = $event.value"