How to use the @mpxjs/webpack-plugin/lib/runtime/components/web/getInnerListeners function in @mpxjs/webpack-plugin

To help you get started, we’ve selected a few @mpxjs/webpack-plugin 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 didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-button.vue View on Github external
if (this.hoverClass && this.hoverClass !== 'none') {
        mergeAfter = {
          listeners: {
            touchstart: this.handleTouchstart,
            touchend: this.handleTouchend
          },
          force: true
        }
      }
      const attrs = {
        name: this.name
      }
      const data = {
        class: ['mpx-button', this.className],
        attrs,
        on: getInnerListeners(this, {
          mergeAfter,
          // 由于当前机制下tap事件只有存在tap监听才会触发,为了确保该组件能够触发tap,传递一个包含tap的defaultListeners用于模拟存在tap监听
          defaultListeners: {
            tap () {
            }
          }
        })
      }
      return createElement('div', data, this.$slots.default)
    },
    methods: {
github didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-navigator.vue View on Github external
const props = {}
      const attrs = {}
      if (this.openType === 'navigate' || this.openType === 'redirect') {
        tagName = 'router-link'
        props.to = this.url
        if (this.openType === 'redirect') {
          props.replace = true
        }
      } else {
        attrs.href = 'javascript:void(0);'
      }
      const data = {
        class: ['mpx-navigator', this.className],
        props,
        attrs,
        on: getInnerListeners(this, {
          mergeAfter,
          // 由于当前机制下tap事件只有存在tap监听才会触发,为了确保该组件能够触发tap,传递一个包含tap的defaultListeners用于模拟存在tap监听
          defaultListeners: {
            tap () {
            }
          }
        })
      }
      return createElement(tagName, data, this.$slots.default)
    },
    computed: {
github didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-checkbox.vue View on Github external
}
        },
        force: true
      }

      const attrs = {
        value: this.value,
        type: 'checkbox',
        checked: this.checked,
        disabled: this.disabled
      }


      const data = {
        class: 'mpx-checkbox',
        on: getInnerListeners(this, { mergeAfter }),
        attrs
      }
      return createElement('input', data, this.$slots.default)
    }
  }
github didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-form.vue View on Github external
render (createElement) {
      const data = {
        class: 'mpx-form',
        on: getInnerListeners(this),
      }
      return createElement('div', data, this.$slots.default)
    },
    mounted () {
github didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-view.vue View on Github external
render (createElement) {
      let mergeAfter
      if (this.hoverClass && this.hoverClass !== 'none') {
        mergeAfter = {
          listeners: {
            touchstart: this.handleTouchstart,
            touchend: this.handleTouchend
          },
          force: true
        }
      }
      const data = {
        class: ['mpx-view', this.className],
        on: getInnerListeners(this, { mergeAfter })
      }
      return createElement('div', data, this.$slots.default)
    },
    computed: {
github didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-checkbox-group.vue View on Github external
render (createElement) {
      const data = {
        class: 'mpx-checkbox-group',
        on: getInnerListeners(this),
      }
      return createElement('div', data, this.$slots.default)
    },
    mounted () {
github didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-text.vue View on Github external
classNames.push('selectable')
      }
      switch (this.space) {
        case 'ensp':
        case 'emsp':
        case 'nbsp':
          decode = true
          text = text.replace(/ /g, `&${this.space};`)
          break
      }
      if (this.decode) {
        decode = true
      }
      const data = {
        class: classNames,
        on: getInnerListeners(this)
      }
      if (decode) {
        data.domProps = {
          innerHTML: text
        }
      }
      return createElement('span', data, slots)
    }
  }
github didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-input.vue View on Github external
const attrs = {
        name: this.name,
        value: this.value,
        type: this.password ? 'password' : this.type,
        placeholder: this.placeholder,
        disabled: this.disabled,
        autofocus: this.focus || this.autoFocus
      }

      if (this.maxlength !== -1) {
        attrs.maxlength = this.maxlength
      }

      const data = {
        class: 'mpx-input',
        on: getInnerListeners(this, { mergeBefore }),
        attrs,
        ref: 'input'
      }
      return createElement('input', data, this.$slots.default)
    },
    methods: {
github didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-textarea.vue View on Github external
placeholder: this.placeholder,
        disabled: this.disabled,
        autofocus: this.focus || this.autoFocus
      }

      if (this.maxlength !== -1) {
        attrs.maxlength = this.maxlength
      }

      const slots = this.$slots.default || []

      const children = slots.concat(this.value)

      const data = {
        class: 'mpx-textarea',
        on: getInnerListeners(this, { mergeBefore }),
        attrs,
        ref: 'textarea'
      }
      return createElement('textarea', data, children)
    },
    methods: {
github didi / mpx / packages / webpack-plugin / lib / runtime / components / web / mpx-image.vue View on Github external
case 'bottom right':
          backgroundPosition = this.mode
          break
      }

      if (backgroundSize) {
        style.backgroundSize = backgroundSize
      }
      if (backgroundPosition) {
        style.backgroundPosition = backgroundPosition
      }

      return createElement('div', {
        style,
        class: ['mpx-image'],
        on: getInnerListeners(this)
      })
    }
  }