ratiw / vuetable-2

data table simplify! -- datatable component for Vue 2.x. See documentation at
https://vuetable.com
MIT License
2.16k stars 399 forks source link

ClearSortOrder() bug. "Avoid mutatiting a prop directly" #570

Open lrembacz opened 5 years ago

lrembacz commented 5 years ago

There is a bug in clearSortOrder() and it could be present in more cases like that, when there are props mutated directly with "=". Props shouldnt be changed in child component. According to docs, there should be an event with value emitted back to parent. https://vuejs.org/v2/guide/components.html#Sending-Messages-to-Parents-with-Events

There is .sync modifier as well. It can be useful with vuex or computed property setter. https://vuejs.org/v2/guide/components-custom-events.html#sync-Modifier

Here is an example with this bug: https://codesandbox.io/s/3qm73n67j5

ratiw commented 5 years ago

@lrembacz Thanks for this. This has been overlooked for a long time.