How to use the heyui/src/utils/utils.isNull function in heyui

To help you get started, we’ve selected a few heyui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heyui / heyui / src / components / checkbox / checkbox.vue View on Github external
setvalue(option) {
      if (this.disabled || (option && option.disabled)) return;
      let value = null;
      if (this.isSingle) {
        if (!utils.isNull(this.value)) {
          value = utils.toggleValue(this.checkList, this.value);
        } else if (!utils.isNull(this.checkStatus)) {
          value = this.isChecked ? this.falseValue : this.trueValue;
        } else if (this.checked === true) {
          value = this.checked;
        } else {
          value = this.isChecked ? this.falseValue : this.trueValue;
        }
      } else {
        value = utils.copy(this.checkStatus);
        let key = option[this.key];
        value = utils.toggleValue(value, key);
        if (this.limit && this.limit < value.length) {
          Message.error(this.t('h.checkbox.limitSize', { limitSize: this.limit }));
          return;
        }
      }
      this.$emit('change', value);
github heyui / heyui / src / utils / config.js View on Github external
getOption(type, name) {
    let key = `${type}`;
    if (!utils.isNull(name)) {
      key = `${type}.${name}`;
    }
    const value = utils.getKeyValue(config, `${key}`);
    if (utils.isNull(value)) {
      console.error(`[HeyUI] Config: There is no dictionary named ${key}`);
      return null;
    }
    return value;
  },
  config(name, value) {
github heyui / heyui / src / components / select / select.vue View on Github external
hasValue() {
      if (this.multiple) {
        return this.codes.length > 0;
      } else {
        return !utils.isNull(this.codes) && this.objects;
      }
    },
    singleValue() {
github heyui / heyui / src / components / date-picker / datepicker.vue View on Github external
parse(value, initShow = true) {
      if (value != '' && !utils.isNull(value)) {
        try {
          this.nowView = manba(value, this.nowFormat);
          this.nowDate = this.nowView.format('k');
          if (initShow) {
            if (this.type == 'week') {
              this.showDate = this.t('h.date.show.weekInput', { year: this.nowView.year(), week: this.nowView.getWeekOfYear(this.startWeek) });
            } else if (this.type == 'quarter') {
              this.showDate = this.t('h.date.show.quarter', { year: this.nowView.year(), quarter: Math.ceil(this.nowView.month() / 3) });
            } else {
              this.showDate = this.nowView.format(this.nowFormat);
            }
          }
          return;
        } catch (err) {
        }
      }
github heyui / heyui / src / components / category-picker / categorypicker.vue View on Github external
getValue(item) {
      if (utils.isNull(item)) {
        return null;
      }
      if (this.type == 'key') {
        return this.categoryObj[item];
      } else {
        return utils.getValue(item, this.param);
      }
    },
    getShow(data) {
github heyui / heyui / src / components / select / select.vue View on Github external
getValue(value) {
      return utils.isNull(value) ? null : value;
    },
    setvalue(option, trigger) {
github heyui / heyui / src / components / cascader / cascader.vue View on Github external
getValue(item) {
      if (utils.isNull(item)) {
        return null;
      }
      if (this.type == 'key') {
        return this.cascaderObj[item];
      } else {
        return utils.getValue(item, this.param);
      }
    },
    dispose() {
github heyui / heyui / src / components / category / category.vue View on Github external
getValue(item) {
      if (utils.isNull(item)) {
        return null;
      }
      if (this.type == 'key') {
        return this.categoryObj[item];
      } else {
        return utils.getValue(item, this.param);
      }
    },
    dispose() {
github heyui / heyui / src / components / checkbox / checkbox.vue View on Github external
updateChecked() {
      if (this.isSingle) {
        if (!utils.isNull(this.value)) {
          this.isChecked = this.checkList.indexOf(this.value) != -1;
        } else if (this.checked === true) {
          this.isChecked = this.checked;
        } else if (this.checkStatus === this.trueValue) {
          this.isChecked = true;
        } else if (this.checkStatus === this.falseValue) {
          this.isChecked = false;
        } else {
          this.isChecked = false;
        }
      }
    },
    setvalue(option) {