0

I have created a table using bootstrap-vue,

<div style="margin-left:300px;margin-right:300px" v-for="logger in loggers" :key="logger">
          <div>
            <b-table :items="items" :fields="fields" striped responsive="sm">
              <template v-slot:cell(all_levels)="row">
                <b-dropdown size="sm" split text="Action" class="m-2">
                  <b-dropdown-item-button>NONE</b-dropdown-item-button>
                  <b-dropdown-item-button>INFO</b-dropdown-item-button>
                  <b-dropdown-item-button>WARN</b-dropdown-item-button>
                  <b-dropdown-item-button>DEBUG</b-dropdown-item-button>
                  <b-dropdown-item-button>FATAL</b-dropdown-item-button>
                </b-dropdown>
              </template>
            </b-table>
          </div>
        </div>

and here's the item data

items: [
        {
          isActive: "",
          Class: "",
          Current_Level: "",
          All_Levels: ""
        }]

I want to update the value of "Class" , "Current_Level" dynamically in "items" array object to display it in the table .

The response data which I am getting in the form of json is something like this : {"com.class","WARN"}

How do I update the value dynamically?

skr
  • 1,700
  • 1
  • 15
  • 39
  • How are you going to update the data. From within the table row, or is it coming from somewhere else? – Hiws Mar 19 '20 at 14:04
  • @Hiws from the json response from server – skr Mar 19 '20 at 14:17
  • Well, you can just do `this.items[0].Class = response['com.class']` and it should update in the table. If you have more than one item, and want to update a specific one, you need a way to identify which one you want to update and do the same as above. – Hiws Mar 19 '20 at 14:57

0 Answers0