Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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: {
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: {
notifyChange (value) {
if (value !== undefined) {
this.setValue(value)
}
// 通过原生input派发事件
this.$refs.textarea.dispatchEvent(getCustomEvent('input'))
},
setSelectionRange (start, end) {
notifyChange (value) {
if (value !== undefined) {
this.setValue(value)
}
// 通过原生input派发事件
this.$refs.input.dispatchEvent(getCustomEvent('input'))
},
setSelectionRange (start, end) {
}
},
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)
}
}
render (createElement) {
const data = {
class: 'mpx-form',
on: getInnerListeners(this),
}
return createElement('div', data, this.$slots.default)
},
mounted () {
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: {
render (createElement) {
const data = {
class: 'mpx-checkbox-group',
on: getInnerListeners(this),
}
return createElement('div', data, this.$slots.default)
},
mounted () {
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)
}
}
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: {