Quasar: QTable - strange __index property

Created on 6 Mar 2019  路  6Comments  路  Source: quasarframework/quasar

Software version


Quasar: all versions since Dec 6, 2017 (this commit)

JsFiddle

v1: https://jsfiddle.net/bezanyu/945mbLns/
v0.15-17: https://jsfiddle.net/bezanyu/noqt956x/

What did you get as the error?

See console output and compare column __index in originalData with table data.

What were you expecting?

__index property not change.

Comment

I found this problem when compare table rows with deep equality for detect user's changes. And found that all rows changed.

How to fix

I not found usage __index property in code. Look like this map call may be removed.

Most helpful comment

Removed the addition of this property. The change will be available in "quasar" v1.4.4.

All 6 comments

Hi,

The __index prop is a helper. Helps to know at which index within your data you are. Useful (and just giving out a random example) for when using slots and you want to add a button to remove the row (you need to know at which index to remove).

I'm binding QTable data to Vuex and I get warnings about state being modified directly. I tracked it down to __index being added to the data.

Is it possible to stop this from happening?

Removed the addition of this property. The change will be available in "quasar" v1.4.4.

The __index prop is a helper. Helps to know at which index within your data you are. Useful (and just giving out a random example) for when using slots and you want to add a button to remove the row (you need to know at which index to remove).

This is my exact use case, and now it breaks after I upgraded quasar. :(

@rstoenescu Is there any alternative to get index inside slot?

Thanks

@pdanpdan

Awesome :tada:
Thanks

Was this page helpful?
0 / 5 - 0 ratings