mirror of
https://github.com/motajs/template.git
synced 2026-11-27 08:24:30 +08:00
fix: delegateExcitable 的 this 指向问题
This commit is contained in:
1 parent
ba90ce6dac
commit
b99ea470f9
1 file changed
+5
-2
@@ -823,11 +823,14 @@ export class MotaRenderer
|
||||
const info: DelegatedExcitable = {
|
||||
id: index,
|
||||
obj: fn,
|
||||
excited: typeof fn === 'function' ? fn : fn.excited,
|
||||
excited:
|
||||
typeof fn === 'function'
|
||||
? (t: number) => fn(t)
|
||||
: (t: number) => fn.excited(t),
|
||||
startTime: this.excitation.payload(),
|
||||
time: time ?? 0,
|
||||
forever: time === void 0,
|
||||
end
|
||||
end: () => end?.()
|
||||
};
|
||||
this.excitables.set(index, info);
|
||||
this.excitablesMap.set(fn, info);
|
||||
|
||||
Reference in new issue
Block a user