提交 0d6f3dc9 编写于 作者: fxy060608's avatar fxy060608

fix(nvue): onPostMessage (#3631)

上级 f1e9c8b8
...@@ -8148,6 +8148,12 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) { ...@@ -8148,6 +8148,12 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
} }
} }
const optionsModifierRE = /(?:Once|Passive|Capture)$/; const optionsModifierRE = /(?:Once|Passive|Capture)$/;
function formatEventName(name) {
if (name === 'on-post-message') {
return 'onPostMessage';
}
return name;
}
function parseName(name) { function parseName(name) {
let options; let options;
if (optionsModifierRE.test(name)) { if (optionsModifierRE.test(name)) {
...@@ -8158,7 +8164,8 @@ function parseName(name) { ...@@ -8158,7 +8164,8 @@ function parseName(name) {
options[m[0].toLowerCase()] = true; options[m[0].toLowerCase()] = true;
} }
} }
return [hyphenate(name.slice(2)), options]; name = name.slice(2);
return [formatEventName(hyphenate(name)), options];
} }
function createInvoker(initialValue, instance) { function createInvoker(initialValue, instance) {
const invoker = (e) => { const invoker = (e) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册