V
V
Victor L2019-03-06 10:42:28
Vue.js
Victor L, 2019-03-06 10:42:28

Buefy Table component how to add dynamic property?

Good morning, tell Buefy the Table component when using Checkable how to add a dynamic property to the selected object
https://codepen.io/Fullzero/pen/MxbRdj?editors=1010
for example when selecting the first row in checkedRows by

{
    "id": 1,
    "first_name": "Jesse",
    "last_name": "Simmons",
    "date": "2016-10-15 13:43:27",
    "gender": "Male"
  }

added "day": "Monday" current day of the week in general

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-03-06
@Fzero0

It is unclear whether you really need to modify the original data. If so, then do watch on checkedRows, where you will check for the presence of a property in the selected objects and add it if not. If not, you make a computed property based on checkedRows, where an array will be created with copies of the selected objects, supplemented with the necessary properties.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question