Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lareinayanyu committed Jan 15, 2025
1 parent 55bf00e commit a5f608c
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions packages/core/src/platform/builtInMixins/proxyEventMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,18 @@ export default function proxyEventMixin () {
},
__model (expr, $event, valuePath = ['value'], filterMethod) {
const innerFilter = {
trim: (val) => typeof val === 'string' && val.trim()
trim: val => typeof val === 'string' && val.trim()
}
const originValue = valuePath.reduce(
(acc, cur) => acc[cur],
$event.detail
)
const value = filterMethod
? innerFilter[filterMethod]
? innerFilter[filterMethod](originValue)
: typeof this[filterMethod] === 'function'
? this[filterMethod](originValue)
: originValue
: originValue
const originValue = valuePath.reduce((acc, cur) => acc[cur], $event.detail)
const value = filterMethod ? (innerFilter[filterMethod] ? innerFilter[filterMethod](originValue) : typeof this[filterMethod] === 'function' ? this[filterMethod](originValue) : originValue) : originValue
setByPath(this, expr, value)
}
}
if (__mpx_mode__ === 'ali') {
Object.assign(methods, {
triggerEvent (eventName, eventDetail) {
const handlerName = eventName
.replace(/^./, (matched) => matched.toUpperCase())
.replace(/-([a-z])/g, (match, p1) => p1.toUpperCase())
const handler =
this.props &&
(this.props['on' + handlerName] || this.props['catch' + handlerName])
const handlerName = eventName.replace(/^./, matched => matched.toUpperCase()).replace(/-([a-z])/g, (match, p1) => p1.toUpperCase())
const handler = this.props && (this.props['on' + handlerName] || this.props['catch' + handlerName])
if (handler && typeof handler === 'function') {
const dataset = collectDataset(this.props)
const id = this.props.id || ''
Expand Down

0 comments on commit a5f608c

Please sign in to comment.