How to use the heyui/src/utils/config.getOption 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 / date-picker / datepicker.vue View on Github external
import Dropdown from 'heyui/src/plugins/dropdown';
import dateBase from 'heyui/src/components/date-picker/datebase';
import Locale from 'heyui/src/mixins/locale';

const prefix = 'h-datetime';

const manbaType = {
  year: manba.YEAR,
  month: manba.MONTH,
  date: manba.DAY,
  datetime: manba.MINUTE,
  time: manba.MINUTE,
  datehour: manba.HOUR
};

const options = config.getOption('datepicker');

export default {
  name: 'hDatePicker',
  mixins: [Locale],
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    readonly: {
      type: Boolean,
      default: false
    },
    type: {
      type: [String],
      default: 'date' // year, month, week
github heyui / heyui / src / components / date-picker / datebase.vue View on Github external
      default: () => config.getOption('datepicker.startWeek')
    }
github heyui / heyui / src / components / checkbox / checkbox.vue View on Github external
      default: () => config.getOption('dict', 'titleName')
    },
github heyui / heyui / src / components / date-full-range-picker / datefullrangepicker.vue View on Github external
data() {
    let format = config.getOption('datepicker.format');
    let defaultType = this.value && this.value.type ? this.value.type : this.defaultType;
    return {
      allviews: {
        year: this.t('h.date.year'),
        quarter: this.t('h.date.quarter'),
        month: this.t('h.date.month'),
        week: this.t('h.date.week'),
        date: this.t('h.date.day'),
        customize: this.t('h.datepicker.customize')
      },
      nowFormat: this.hasTime ? format.datetime : format.date,
      paramName: config.getOption('datepicker.daterangeOptions.paramName'),
      nowDate: {
        start: '',
        end: ''
      },
      nowView: {
        start: manba(),
        end: manba().add(1, manba.MONTH)
      },
      view: defaultType,
      rangeEnd: '',
      isShow: false
    };
  },
  beforeMount() {
github heyui / heyui / src / components / category-picker / categorypicker.vue View on Github external
param() {
      if (this.config) {
        return utils.extend({}, config.getOption('categoryPicker.default'), config.getOption(
          `categoryPicker.configs.${this.config}`), this.option);
      } else {
        return utils.extend({}, config.getOption('categoryPicker.default'), this.option);
      }
    },
    categoryCls() {
github heyui / heyui / src / plugins / modal / index.js View on Github external
import Notify from 'heyui/src/plugins/notify';
import utils from 'heyui/src/utils/utils';
import config from 'heyui/src/utils/config';

const prefixCls = 'h-modal';
const hasDivider = config.getOption('modal', 'hasDivider');

let Vue = null;

let Default = {
  middle: false,
  hasDivider,
  fullScreen: false,
  className: ''
};

function Modal(originalParam) {
  let cls = prefixCls;
  let param = utils.extend({ hasMask: true, closeOnMask: true, buttons: ['cancel'] }, Default, originalParam, true);

  if (originalParam.hasDivider || Default.hasDivider) {
    param.className += ` h-modal-has-divider`;
github heyui / heyui / src / components / tree-picker / treepicker.vue View on Github external
param() {
      if (this.config) {
        return utils.extend({},
          config.getOption('tree.default'),
          config.getOption(`tree.configs.${this.config}`),
          this.option
        );
      } else {
        return utils.extend({}, config.getOption('tree.default'), this.option);
      }
    },
    showCls() {
github heyui / heyui / src / components / pagination / pagination.vue View on Github external
sizesShow() {
      const keyField = config.getOption('dict', 'keyName');
      const titleField = config.getOption('dict', 'titleName');
      return this.sizes.map(item => {
        return {
          [keyField]: item,
          [titleField]: this.t('h.pagination.sizeOfPage', { size: item })
        };
      });
    },
    curNow() {