改变后端返回的数组中对象的属性名

 // 获取区域和街道
    getAreaList() {
      let id = "";
      getArea(id).then((res) => {
        let data = res.data;
        this.areaOption = JSON.parse(
          JSON.stringify(data).replace(/xzqhmc/g, "label")
        );
        console.log(this.areaOption, `this`);
      });
    },





转换后

posted @ 2022-10-24 08:41  xuelin  阅读(39)  评论(0)    收藏  举报