zoukankan      html  css  js  c++  java
  • vue 根据下拉框动态切换form的rule

    taskCategorySelect (val) {  // 任务类别下拉选择
    if ( val == 5 ) {
    this.cameraORgateway = false; // true不可以使用 = 不可以使用
    this.cameraORgatewayCP = true;
    this.rules.gatewayCode = [{ required: true, message: '请选择关联网关', trigger: 'blur' }];
    this.rules.cameraCode = [{}];
    this.$refs['form'].clearValidate('cameraCode');
    this.form.cameraCode = undefined;
    } else if ( val == 1 || val == 2 || val == 3 || val == 4) {
    this.cameraORgateway = true; // false不可以使用 = 可以使用
    this.cameraORgatewayCP = false;
    this.rules.cameraCode = [{ required: true, message: '请选择摄像机', trigger: 'blur' }];
    this.rules.gatewayCode = [{}];
    this.form.gatewayCode = undefined;
    } else {
    this.cameraORgateway = true;
    this.cameraORgatewayCP = true;
    this.form.cameraCode = undefined;
    this.form.gatewayCode = undefined;
    }
    },
  • 相关阅读:
    每日日报
    设计模式分类及典型实现
    SpringBean的生命周期
    Nginx
    大话--单例模式
    类图--小总结
    设计模式原则概述
    大话--装饰者模式
    Redis基础
    SpringIOC的实现原理
  • 原文地址:https://www.cnblogs.com/luoxuemei/p/9719271.html
Copyright © 2011-2022 走看看