0👍
If I understood well your question, you have a key
property in each of the rows of your tableData3
data. You want to show the user whether the row has been selected or not depending on if key
is true
or false
.
You could do that in the mounted
method:
- You select the rows to toggle by removing the ones that are false using the array’s
filter
method. - You toggle these rows using the
toggleSelection
method
mounted() {
const rowsToToggle = this.tableData3.filter(row => row.key)
this.toggleSelection(rowsToToggle)
}
Here is the fiddle with the associated behavior. Hope it help you.
- [Vuejs]-How do I implement Vue Router while using Vue UI?
- [Vuejs]-Firestore How to Add User Document to Collection at Sign-in with FirebaseUI
Source:stackexchange.com