Nativescript-vue: Not able to update data in Listview in Tabview

Created on 2 Jul 2019  路  6Comments  路  Source: nativescript-vue/nativescript-vue

Version

2.3.0-rc.1

Reproduction link

https://play.nativescript.org/?template=play-vue&id=9Fk7AS&v=10

Platform and OS info

Still under development

Steps to reproduce

Make a with a for loop example item in itemList. The itemList have to be empty. Make a watch or something else af add items til the itemList. If you are at the first tab nothing appen, if you press tab 2 and back to tab 1 the data would be added.

What is expected?

The listView should have data from the props and watch for changes and then update/add to the existing

What is actually happening?

The listView doesn't update.

normal

Most helpful comment

If you enable logs in app.js, you can see

ERROR: [Vue warn]: Property or method "selectedIndex" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

found in

---> <HelloWorld>
<Frame>
<Root>

If I change

 <TabView :selectedIndex="selectedIndex" @selectedIndexChange="indexChange">

to just

 <TabView>

It works as expected.

All 6 comments

@maikenmadsen1992 When trying your playground it errors out because the ObservableArray has not been imported. After importing it, it runs fine, but I can't see any tabs in the code. Can you confirm you've linked the correct playground?

I have updated the playground link, i'm so sorry I uploaded something wrong :-S

I have also made another playground with a much simpler example: https://play.nativescript.org/?template=play-vue&id=7hhWp4&v=2

When the user press the button the listView have to update and show the new data without having to press tab 2 and back to tab 1.

If you enable logs in app.js, you can see

ERROR: [Vue warn]: Property or method "selectedIndex" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

found in

---> <HelloWorld>
<Frame>
<Root>

If I change

 <TabView :selectedIndex="selectedIndex" @selectedIndexChange="indexChange">

to just

 <TabView>

It works as expected.

Thank you so much! now it's working! that was the weirdest thing. :-)

We are locking this issue because it has been closed for more than 14 days.

If the issue comes up again please open a new issue with additional details.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tralves picture tralves  路  4Comments

justinbeatz picture justinbeatz  路  3Comments

packytagliaferro picture packytagliaferro  路  5Comments

Fabiyo-90 picture Fabiyo-90  路  6Comments

jarden-liu picture jarden-liu  路  3Comments