ratiw / vue-table

data table simplify! -- vuetable is a Vue.js component that will automatically request (JSON) data from the server and display them nicely in html table with swappable/extensible pagination component.
MIT License
1.83k stars 303 forks source link

How to clear/empty vuetable rows ? #158

Open jorwan opened 7 years ago

jorwan commented 7 years ago

Hi, thanks for this great component

I would like to empty vuetable on response with errors as 404, or 500, etc

And for any other case, i would like to know how to empty/clear the vuetable rows ?

Thanks

ratiw commented 7 years ago

Use v-ref to create a reference to your vuetable, then set the tableData to empty array [], like so

<vuetable v-ref="vuetable"></vuetable>
this.$refs.vuetable.tableData = []