Using the set method of vue, the view is not updated as the data changes.

how to update the data obtained by ajax to the view, using the set method, but I really don"t know what the problem is that the
call is not posted. It has been verified that the function can be called.

Thank you for your guidance. Update: adding the direction of this does not work

HTML section:
< div id= "wrap" >

    <div id="main" v-for="(item,index) in TaskList">
        <div class="task_list" v-on:click.stop="Carlist(item.task_id)">
            <!--  -->
            <div class="task_item">
                <!--  -->
                <div class="item_title">
                <div class="info">
                            <span>:</span>
                            <span v-text="item.vehicle_type" class="Ecu_info"></span>
                            <span>:</span>
                            <span v-text="item.done" id="info-done"></span>
                        </div>
                

JS section:

var taskVue = new Vue ({

    el: "-sharpwrap",
    data: {
        page: 0,
        length: 100,
        TaskList:[],  ****
        search_mes: "",
        index: "",
    },
    methods: {
        dataAjax: function() {
          let self = this;
          api.ajax({
              url: "https://apigatewayqa.sgmlink.com:13120/tds3_rrf/select_ecu_upgrade_task_list",
              method: "post",
              returnAll: true,
              data: {
                  body: JSON.stringify({
                      "condition": "",
                      "pageinfo": {
                          "pageindex": "1",
                          "pagesize": "-1"
                      }

                  }),
              }
          }, function(ret, err) {
              if (ret && ret.statusCode == 200) {
                  var arry = ret.body.data.tasks;  ****
                   self.TaskList = arry; ****
                   self.$set(self.TaskList,arry); **set**
              } else {
                  console.log(JSON.stringify(err));
              }
          })
        }
    }
});
                
                


Apr.05,2021
The this direction in the

callback function has changed. Add a let self = this at the beginning of the dataAjax function, and then use self.$set


in the callback

didn't you report $set is not a function


this

Menu