How to make multiple table switch selected state at the same time in vue

1. At present, the function you want to achieve is to select all the tables by default after the page has loaded multiple tables. Now ref is set up in every table

clipboard.png

created()

clipboard.png

"vod_table"

clipboard.png

Gods, ask for advice

May.25,2022

bound to the same value?


modify the data corresponding to table. Vue takes a certain amount of time to complete the rendering of page elements. It is invalid to call toggleAllSeciton before rendering is complete.

it is recommended to put the call to toggleAllSeciton into the callback function of nextTick, such as

Vue.nextTick (function () {
this.$refs.tableA.toggleAllSeciton ()
this.$refs.tableB.toggleAllSeciton ()
this.$refs.tableC.toggleAllSeciton ()
})

Menu