How to use the heyui/locale.t 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 / validator / validation / typeValids.js View on Github external
message() {
      return locale.t('h.validation.type.globalmobile');
    }
  } // international mobile
github heyui / heyui / src / plugins / validator / validation / typeValids.js View on Github external
message() {
      return locale.t('h.validation.type.url');
    }
  },
github heyui / heyui / src / plugins / validator / validation / baseValids.js View on Github external
maxLen(value, configValue) {
    if (configValue === null || configValue === undefined) {
      return true;
    }
    let result = value !== null && value !== undefined && String(value).length <= configValue;
    return result === true ? true : locale.t('h.validation.base.maxLen', { value: configValue });
  },
  minLen(value, configValue) {
github heyui / heyui / src / plugins / validator / validation / baseValids.js View on Github external
required(value) {
    let result = value !== null && value !== undefined && String(value).length > 0;
    return result === true ? true : locale.t('h.validation.base.required');
  },
  maxLen(value, configValue) {
github heyui / heyui / src / plugins / validator / validation / typeValids.js View on Github external
message() {
      return locale.t('h.validation.type.number');
    }
  },
github heyui / heyui / src / plugins / validator / validation / typeValids.js View on Github external
message() {
      return locale.t('h.validation.type.tel');
    }
  },
github heyui / heyui / src / plugins / confirm / index.js View on Github external
function confirm(content, title) {
  if (!title) {
    title = locale.t('h.confirm.title');
  }
  return Confirm(content, title);
}
github heyui / heyui / src / plugins / validator / validation / baseValids.js View on Github external
max(value, configValue) {
    if (configValue === null || configValue === undefined) {
      return true;
    }
    let result = value !== null && value !== undefined && Number(value) <= configValue;
    return result === true ? true : locale.t('h.validation.base.max', { value: configValue });
  },
  min(value, configValue) {
github heyui / heyui / src / plugins / validator / validation / baseValids.js View on Github external
minLen(value, configValue) {
    if (configValue === null || configValue === undefined) {
      return true;
    }
    let result = value !== null && value !== undefined && String(value).length >= configValue;
    return result === true ? true : locale.t('h.validation.base.minLen', { value: configValue });
  },
  max(value, configValue) {
github heyui / heyui / src / plugins / validator / validation / typeValids.js View on Github external
import locale from 'heyui/locale';

let valids = {
  int: {
    valid(value) {
      return parseInt(value, 10) == value;
    },
    message: locale.t('h.validation.type.int')
  },
  number: {
    valid(value) {
      return !isNaN(Number(value));
    },
    message() {
      return locale.t('h.validation.type.number');
    }
  },
  email: {
    pattern: /^[^\s]+@[^\s]+\.[^\s]+$/,
    message() {
      return locale.t('h.validation.type.email');
    }
  },
  url: {