How to use the yox.logger function in yox

To help you get started, we’ve selected a few yox 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 divawth / bell-ui / src / component / datepicker / DatePicker.ts View on Github external
handleShortcutClick(data: Shortcut) {
      const value = data.onClick.call(this)
      if (Yox.is.array(value)) {
        if (!value[0] || !value[1]) {
          Yox.logger.warn(`shortcuts value 传值错误`)
          return
        }
        this.dateRangeChange(
          toTimestamp(value[0]),
          toTimestamp(value[1])
        )
      }
      else {
        if (!value) {
          Yox.logger.warn(`shortcuts value 传值错误`)
          return
        }
        const type = this.get('type')
        if (type === RAW_TYPE_DATE_RANGE || type === RAW_TYPE_WEEK) {
          Yox.logger.warn(`shortcuts value 需返回数组类型`)
          return
        }
        this.dateChange(
          toTimestamp(value as any)
        )
      }
    },
github divawth / bell-ui / src / components / util.ts View on Github external
return function (key: string, value: any, componentName: string | undefined) {
    if (!Yox.array.has(values, value)) {
      Yox.logger.warn(`${key} 期望是 ${values.join(',')} 中的值,实际传值 [${value}]。`, componentName)
    }
    return TRUE
  }
}
github divawth / bell-ui / dist / components / datepicker / DatePicker.js View on Github external
shortcutClick: function (data) {
            var date = data.value && data.value();
            if (!date) {
                Yox.logger.warn("shortcuts value \u4F20\u503C\u9519\u8BEF");
                return;
            }
            if (!Yox.is.array(date)) {
                date = simplifyDate(date);
                this.dateChange(date);
            }
            else {
                this.dateRangeChange({
                    start: simplifyDate(date[0]),
                    end: simplifyDate(date[1])
                });
            }
            this.set({
                value: date
            });
            data.onClick && data.onClick();
github divawth / bell-ui / src / components / util.ts View on Github external
return function (key: string, value: Date) {
    if (value instanceof Date) {
      return true
    }
    Yox.logger.warn(`${key} 期望是 Date 类型,实际传值 ${value}。`)
  }
}
github divawth / bell-ui / dist / components / dropdown / Dropdown.js View on Github external
type: function (props, key) {
                if (props['trigger'] !== RAW_CUSTOM) {
                    Yox.logger.warn(key + " \u671F\u671B\u5728 trigger \u53D6\u503C\u4E3A custom \u65F6\u4F20\u503C");
                }
                return true;
            }
        },
github divawth / bell-ui / src / component / backtop / BackTop.ts View on Github external
afterMount() {

    const me = this

    let container: Document | HTMLElement = DOCUMENT
    let containerElement = DOCUMENT.documentElement

    const target = me.get('target')
    if (target) {
      containerElement = Yox.dom.find(target) as HTMLElement
      if (!containerElement) {
        Yox.logger.fatal(`target is not existed: ${target}`)
        return
      }
      container = containerElement
    }

    const height = toNumber(me.get('height'))
    const onRefresh = function () {
      me.set({
        visible: containerElement.scrollTop >= height
      })
    }

    const duration = toNumber(this.get('duration'))
    me.on('click', function () {
      scrollTop(
        containerElement,

yox

A lightweight mvvm framework

MIT
Latest version published 1 year ago

Package Health Score

49 / 100
Full package analysis