首页 > 其他 > 详细

vue watch

时间:2020-10-30 15:00:35      阅读:23      评论:0      收藏:0      [点我收藏+]
watch: {
    // 当为谁咨询是自己的时候, 将页面信息全初始化为本人信息, 否则, 初始为空
    "form.findfor"(val) {
      if (this.applyloacluserInfo == null) {
        if (this.form.findfor == "自己") {
          this.form.forname = this.loacluserInfo.username;
          this.phone = this.loacluserInfo.phone;
        } else {
          this.form.forname = "";
          this.form.sex = "请选择";
          this.form.age = "";
          this.phone = "";
        }
        return;
      }
      if (this.applyloacluserInfo.findfor == this.form.findfor) {
        this.form.forname = this.applyloacluserInfo.forname;
        this.form.findfor = this.applyloacluserInfo.findfor;
        this.form.age = this.applyloacluserInfo.age;
        this.form.sex = this.applyloacluserInfo.sex;
        var d = this.userworkPhone;
        d = d.replace(‘"‘, "").replace(‘"‘, "");
        d = d.replace(/\"/g, "");
        this.phone = d;
      } else {
        if (this.form.findfor == "自己") {
          this.form.findfor = "自己";
          this.form.sex = "请选择";
          this.form.age = "";
          this.form.forname = this.loacluserInfo.username;
          this.phone = this.loacluserInfo.phone;
        } else {
          this.form.forname = "";
          this.form.sex = "请选择";
          this.form.age = "";
          this.phone = "";
        }
      }
    }
  },

vue watch

原文:https://www.cnblogs.com/ylblogs/p/13901121.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!