Skip to content

Commit

Permalink
fix: unit error
Browse files Browse the repository at this point in the history
  • Loading branch information
lareinayanyu committed Jan 8, 2025
1 parent da5ada4 commit e64e743
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function proxyEventMixin () {
const value = filterMethod ? (innerFilter[filterMethod] ? innerFilter[filterMethod](originValue) : typeof this[filterMethod] === 'function' && this[filterMethod]) : originValue
setByPath(this, expr, value)
},
__invokeHandler (rawEvent, eventConfig = []) {
__invoke (rawEvent, eventConfig = []) {
if (typeof Mpx.config.proxyEventHandler === 'function') {
try {
Mpx.config.proxyEventHandler(rawEvent)
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-plugin/lib/template-compiler/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ function processEventWeb (el) {
} while (has)
}
})
const value = `(e)=>__invokeHandler(e, [${configs.map(
const value = `(e)=>__invoke(e, [${configs.map(
(item) => item.expStr
)}])`
addAttrs(el, [
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-plugin/test/platform/common/mode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('template should transform correct', function () {
it('should work correct with web mode', function () {
const input = '<button @click@web="handleClick">获取用户信息</button>'
const output = compileTemplate(input, { mode: 'web' })
expect(output).toBe('<mpx-button @click="handleClick">获取用户信息</mpx-button>')
expect(output).toBe('<mpx-button @click="(e)=>__invoke(e, [[handleClick]])">获取用户信息</mpx-button>')
})

it('should work normal if no attr in tag', function () {
Expand Down

0 comments on commit e64e743

Please sign in to comment.