element select选择框 ajax返回值怎么赋给选择框?

    <el-form-item label="市">
         <el-select v-model="form.m_address2" placeholder="请选择">
         <el-option v-for="item1 in fromData.a2" :label="item1.city_name" :value="item1.city_id">
         </el-option>
         </el-select>
         </el-form-item> 
         
         
         var Main = {
          data() {          return {
          a2:[],
        }
      }
    }
    
     methods: {

    selectMajor:function(){
      var that = this;
      $.ajax({
              url:"{:url('Member/getProvince')}",              type: 'POST',
              data: {'address1':this.form.m_address1},
              success:function(data){
                console.log(JSON.stringify (data));
                that.a2=JSON.stringify(data);
              },error:function(data){
                  alert("网络错误!请稍后再试!");
              },
           });
    },


守着星空守着你
浏览 1720回答 2
2回答

呼如林

你值取错了吧 是 m_address2
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5