iT邦幫忙

0

[已解決] Vue js v-on:change 篩選後端API資料

HI大家好, 目前想實作vue.js select v-on:change 來篩選後端API的資料, 但發現資料都沒回來請問是哪邊有做錯呢?? 還煩請各位大大指點迷津 謝謝

data:{
selected_target: {}
}
, methods: {
         , LoadData: function (data) {
             var thisVue = this; 
             return $.ajax({
             method: "POST"
             , url: "@Url.Action("LoadDataList", "LodData")"
             , data: {data_id: data.id}
             , success: function (result, textStatus, jqXHR) {
               if (result.code == "S") {
                   thisVue.selected_target = result.Data;
                }
               else {alertResultModel(result);}
             }
          , error: function (jqXHR, textStatus, errorThrown) {
               alertError("error");
             }
     });
}
      , SelectTarget: function (event) {
          this.selected_target = event.target.value;
          console.log(this.selected_target)
      }
<select class="form-control"
    v-model="selected_target"
    v-on:change="SelectTarget($event)">
    <option selected>請選擇...</option>
    <option v-for="data in Data_List"
            v-bind:value="data.id">
          {{ data.name }}
    </option>
</select>
Homura iT邦高手 1 級 ‧ 2021-09-14 10:58:28 檢舉
沒看到你呼叫LoadData啊...
Season iT邦研究生 4 級 ‧ 2021-09-15 09:25:21 檢舉
url: "@Url.Action("LoadDataList", "LodData")" LodData? LoadData? 少一個a?
小火車 iT邦新手 4 級 ‧ 2021-09-16 00:27:51 檢舉
感謝各位高手, 我犯了愚蠢的錯誤如 xSummer大大所說 謝謝回復
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答