A
A
Andrey Rudakov2022-01-11 21:52:29
Vue.js
Andrey Rudakov, 2022-01-11 21:52:29

BootstrapTable vuejs how to update field programmatically?

Greetings.
Using VUEJS and BootstrapTable

<b-table
        ref="refShopListTable"
        class="position-relative min-height-250"
        :items="fetchShops"
        responsive
        :fields="tableColumns"
        primary-key="id"
        :sort-by.sync="sortBy"
        show-empty
        empty-text="Магазины не найдены ‍♀"
        :sort-desc.sync="isSortDirDesc"
      >

Data arrives via API as a promise.
How do I reactively change the data of a column (cells of any row)?
I already figured out how to change when interacting with the line (if you click on it, etc.).
But how do I update a field in a row without clicking on the row?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ice, 2022-01-12
@DEMETRA-WORK

It would be more correct:
1) create an array of items in data
2) create a method for the init example in which the request will be executed.
Throw out resolve from the promise, do the check, and push the data into the data array items
3) create a mounted hook in which you execute your this.init()
4) replace :items with your items from the date
Work with the items array

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question