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

chore: build

上级 2f7b3e55
......@@ -1183,8 +1183,11 @@ function createComponentDescriptor(vm, isOwnerInstance = true) {
function getComponentDescriptor(instance2, isOwnerInstance) {
return createComponentDescriptor(instance2, isOwnerInstance);
}
function resolveOwnerComponentPublicInstance(eventValue, instance2) {
if (!instance2 || eventValue.length < 2) {
function resolveOwnerComponentPublicInstance(eventValue, instance2, checkArgsLength = true) {
if (!instance2) {
return false;
}
if (checkArgsLength && eventValue.length < 2) {
return false;
}
const ownerVm = resolveOwnerVm(instance2);
......@@ -1197,14 +1200,14 @@ function resolveOwnerComponentPublicInstance(eventValue, instance2) {
}
return ownerVm;
}
function wrapperH5WxsEvent(event, eventValue, instance2) {
function wrapperH5WxsEvent(event, eventValue, instance2, checkArgsLength = true) {
if (eventValue) {
Object.defineProperty(event, "instance", {
get() {
return getComponentDescriptor(instance2.proxy, false);
}
});
const ownerVm = resolveOwnerComponentPublicInstance(eventValue, instance2);
const ownerVm = resolveOwnerComponentPublicInstance(eventValue, instance2, checkArgsLength);
if (ownerVm) {
return [event, getComponentDescriptor(ownerVm, false)];
}
......@@ -1228,7 +1231,7 @@ function $nne(evt, eventValue, instance2) {
const isHTMLTarget = currentTarget.tagName.indexOf("UNI-") !== 0;
{
if (isHTMLTarget) {
return [evt];
return wrapperH5WxsEvent(evt, eventValue, instance2, false) || [evt];
}
}
const res = createNativeEvent(evt, isHTMLTarget);
......
......@@ -65,6 +65,7 @@ export function initEnv(
if (options.plugin) {
process.env.UNI_MP_PLUGIN = 'true'
}
// TODO 需要识别 mode
if (type === 'dev') {
process.env.NODE_ENV = 'development'
} else if (type === 'build') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册