How to use the heyui/src/utils/utils.isString 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 / plugins / notice / index.js View on Github external
function notice(param, timeout) {
  if (utils.isString(param)) {
    return Notice({ content: param, timeout });
  } else if (utils.isObject(param)) {
    if (this) {
      if (this.$router) {
        param.$router = this.$router;
      }
      if (this.$i18n) {
        param.$i18n = this.$i18n;
      }
      if (this.$store) {
        param.$store = this.$store;
      }
    }
    return Notice(param);
  }
  console.error('Notice params are incorrect:', param);
github heyui / heyui / src / utils / config.js View on Github external
dictMapping(value, key, connector) {
    let dict = this.getDict(key);
    if (!dict || utils.isNull(value)) return '';
    if (utils.isString(value) && connector) {
      value = value.split(connector);
    }
    if (!utils.isNull(value) && value !== '' && key) {
      if (!utils.isArray(value)) {
        value = [value];
      }
    }
    if (value.length <= 0) {
      return '';
    }

    const keyField = this.getOption('dict', 'keyName');
    const titleField = this.getOption('dict', 'titleName');

    if (utils.isArray(dict)) {
      dict = utils.toObject(dict, keyField);
github heyui / heyui / src / plugins / notice / index.js View on Github external
function noticeWithType(type, param, timeout) {
  if (utils.isString(param)) {
    return Notice({ content: param, timeout, type });
  } else if (utils.isObject(param)) {
    if (type) param.type = type;
    return Notice(param);
  }
  console.error('Notice params are incorrect:', param);
}
github heyui / heyui / src / components / menu / menu-item.vue View on Github external
href() {
      let href = this.data.value.href;
      if (href) {
        if (utils.isString(href)) {
          return href;
        } else if (this.$router) {
          return this.$router.resolve(href).href;
        }
      }
      return null;
    }
  }
github heyui / heyui / src / components / date-full-range-picker / datefullrangepicker.vue View on Github external
shortcuts() {
      let shortcuts = [];
      let shortcutsConfig = null;
      if (this.option && this.option.shortcuts) {
        shortcutsConfig = this.option.shortcuts;
      }
      if (utils.isArray(shortcutsConfig)) {
        for (let s of shortcutsConfig) {
          if (utils.isString(s)) {
            shortcuts.push(config.getOption('datepicker.shortcuts')[s]);
          } else if (utils.isObject(s)) {
            shortcuts.push(s);
          }
        }
      }
      return shortcuts;
    },
    dateCls() {
github heyui / heyui / src / components / uploader / uploader.vue View on Github external
const parse = function (value, param) {
  if (utils.isString(value)) {
    return { url: value, original: { [param.urlName]: value } };
  } else if (utils.isObject(value)) {
    return { url: value[param.urlName], name: value[param.fileName], thumbUrl: value.thumbUrl || param.thumbUrl.call(value), original: value };
  }
};
const dispose = function (value, type, param) {
github heyui / heyui / src / components / date-picker / datepicker.vue View on Github external
shortcuts() {
      let shortcuts = [];
      let shortcutsConfig = null;
      if (this.option && this.option.shortcuts) {
        shortcutsConfig = this.option.shortcuts;
      }
      if (utils.isArray(shortcutsConfig)) {
        for (let s of shortcutsConfig) {
          if (utils.isString(s)) {
            shortcuts.push(options.shortcuts[s]);
          } else if (utils.isObject(s)) {
            shortcuts.push(s);
          }
        }
      }
      return shortcuts;
    },
    dateCls() {
github heyui / heyui / src / plugins / image-preview / image-preview-modal.vue View on Github external
updatePreview() {
      if (this.computedDatas.length == 0 || this.isShow === false) {
        return {};
      }
      let data = this.computedDatas[this.showIndex];
      let previewFile = utils.isString(data) ? { url: data } : data;
      if (previewFile.url == this.previewFile.url) {
        this.$nextTick(() => {
          if (this.$refs.img && this.$refs.img.complete) {
            setTimeout(() => {
              this.changeing = false;
            }, 300);
          }
        });
      }
      this.previewFile = previewFile;
    }
  },
github heyui / heyui / src / components / date-range-picker / daterangepicker.vue View on Github external
shortcuts() {
      let shortcuts = [];
      let shortcutsConfig = null;
      if (this.option && this.option.shortcuts) {
        shortcutsConfig = this.option.shortcuts;
      }
      if (utils.isArray(shortcutsConfig)) {
        for (let s of shortcutsConfig) {
          if (utils.isString(s)) {
            shortcuts.push(config.getOption('datepicker.shortcuts')[s]);
          } else if (utils.isObject(s)) {
            shortcuts.push(s);
          }
        }
      }
      return shortcuts;
    },
    dateCls() {
github heyui / heyui / src / components / image-preview / imagepreview.vue View on Github external
isSingle() {
      return utils.isString(this.datas);
    },
    computedList() {