前端工作总结113-点击按钮报错--bug修复--直接写接口里面

   this.title = "编辑";
      getAction(path.join(this.url.query, id))
          .then(res => {
            this.form = res.data;
 
          })
          .catch(err => {
            this.form = JSON.parse(JSON.stringify(this.defaultForm));
            this.$message.warning("获取数据失败!");
          })
          .finally(() => {
            console.log("我是type"+this.form.content_type)
            if(this.form.content_type==2){
              this.attr=1
            }else{
              this.attr=2
            }
            console.log("我是attr"+this.attr)
            this.loading = false;
          });
    },

posted @ 2022-09-10 19:41  前端导师歌谣  阅读(24)  评论(0)    收藏  举报