How to use the yox.object 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 / notification / index.ts View on Github external
function addNotification(status: string,  data: Data, onClose?: Function) {

  let props: Data = { status }

  // 先写 config,可支持 data 覆盖全局配置
  Yox.object.extend(props, config)

  if (Yox.is.string(data)) {
    props.content = data
  }
  else {
    Yox.object.extend(props, data)
  }

  const instance: any = new Yox(
    Yox.object.extend(
      {
        el: '#${prefix}notification-wrapper',
        props,
      },
      Notification
    )
  )

  instance.on('hide.notification', function () {
    if (onClose) {
      onClose()
    }
github divawth / bell-ui / src / component / notification / index.ts View on Github external
function addNotification(status: string,  data: Data, onClose?: Function) {

  let props: Data = { status }

  // 先写 config,可支持 data 覆盖全局配置
  Yox.object.extend(props, config)

  if (Yox.is.string(data)) {
    props.content = data
  }
  else {
    Yox.object.extend(props, data)
  }

  const instance: any = new Yox(
    Yox.object.extend(
      {
        el: '#${prefix}notification-wrapper',
        props,
      },
      Notification
    )
github divawth / bell-ui / dist / components / notice / Notice.js View on Github external
var addNotice = function (type, arg) {
    var data = {};
    data.type = type;
    if (Yox.is.string(arg)) {
        data.content = arg;
    }
    else {
        Yox.object.extend(data, arg);
        Yox.object.extend(data, config);
    }
    add(data);
};
var updateConfig = function (data) {
github divawth / bell-ui / src / component / modal / index.ts View on Github external
props.title = obj.title
    props.content = obj.content
    props.width = obj.width
    props.okText = obj.okText
    props.okType = obj.okType
    props.onOk = obj.onOk
    props.cancelText = obj.cancelText
    props.cancelType = obj.cancelType
    props.onCancel = obj.onCancel
  }
  else {
    props.content = data as string
  }

  new Yox(
    Yox.object.extend(
      {
        el: BODY,
        props,
      },
      Confirm
    )
  )

}
github divawth / bell-ui / dist / components / message / Message.js View on Github external
var addMessage = function (type, arg) {
    var data = {};
    data.type = type;
    if (Yox.is.string(arg)) {
        data.content = arg;
    }
    else {
        Yox.object.extend(data, arg);
        Yox.object.extend(data, config);
    }
    add(data);
};
var updateConfig = function (data) {
github divawth / bell-ui / src / component / loading-bar / index.ts View on Github external
function add(props: Config | void) {

  const wrapper = Yox.dom.find('#${prefix}loadingbar-wrapper') as HTMLElement

  instance = new Yox(
    Yox.object.extend(
      {
        el: wrapper,
        props,
      },
      LoadingBar
    )
  )

  return instance

}
github divawth / bell-ui / dist / components / message / Message.js View on Github external
var addMessage = function (type, arg) {
    var data = {};
    data.type = type;
    if (Yox.is.string(arg)) {
        data.content = arg;
    }
    else {
        Yox.object.extend(data, arg);
        Yox.object.extend(data, config);
    }
    add(data);
};
var updateConfig = function (data) {
github divawth / bell-ui / dist / components / notice / Notice.js View on Github external
var addNotice = function (type, arg) {
    var data = {};
    data.type = type;
    if (Yox.is.string(arg)) {
        data.content = arg;
    }
    else {
        Yox.object.extend(data, arg);
        Yox.object.extend(data, config);
    }
    add(data);
};
var updateConfig = function (data) {
github divawth / bell-ui / src / component / message / index.ts View on Github external
function addMessage(status: string, arg: Arg, onClose?: Function) {

  const props: Data = { status }

  Yox.object.extend(props, config)

  if (Yox.is.string(arg)) {
    props.content = arg as string
  }
  else {
    Yox.object.extend(props, arg as Data)
  }

  const instance: any = new Yox(
    Yox.object.extend(
      {
        el: BODY,
        props,
      },
      Message
    )

yox

A lightweight mvvm framework

MIT
Latest version published 1 year ago

Package Health Score

49 / 100
Full package analysis