小程序的features处理有问题

This commit is contained in:
Xu Chang 2024-05-15 16:23:09 +08:00
parent 07a463b208
commit 5188caea0b
3 changed files with 30 additions and 30 deletions

View File

@ -767,8 +767,8 @@ export function createComponent(option, features) {
else {
assert(typeof ele === 'object');
const { feature, behavior, callback } = ele;
if (behavior) {
this.addFeatureSub(feature, () => {
this.addFeatureSub(feature, () => {
if (behavior) {
switch (behavior) {
case 'reRender': {
this.reRender();
@ -780,14 +780,14 @@ export function createComponent(option, features) {
return;
}
}
});
}
else if (callback) {
callback.call(this);
}
else {
this.reRender();
}
}
else if (callback) {
callback.call(this);
}
else {
this.reRender();
}
});
}
});
}

View File

@ -770,8 +770,8 @@ function createComponent(option, features) {
else {
(0, assert_1.assert)(typeof ele === 'object');
const { feature, behavior, callback } = ele;
if (behavior) {
this.addFeatureSub(feature, () => {
this.addFeatureSub(feature, () => {
if (behavior) {
switch (behavior) {
case 'reRender': {
this.reRender();
@ -783,14 +783,14 @@ function createComponent(option, features) {
return;
}
}
});
}
else if (callback) {
callback.call(this);
}
else {
this.reRender();
}
}
else if (callback) {
callback.call(this);
}
else {
this.reRender();
}
});
}
});
}

View File

@ -1087,8 +1087,8 @@ export function createComponent<
} else {
assert(typeof ele === 'object');
const { feature, behavior, callback } = ele;
if (behavior) {
this.addFeatureSub(feature, () => {
this.addFeatureSub(feature as string, () => {
if (behavior) {
switch (behavior) {
case 'reRender': {
this.reRender();
@ -1100,14 +1100,14 @@ export function createComponent<
return;
}
}
});
}
else if (callback) {
callback.call(this as any);
}
else {
this.reRender();
}
}
else if (callback) {
callback.call(this as any);
}
else {
this.reRender();
}
});
}
});
}