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

chore: build

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