mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 09:48:30 +08:00
fix node registe event function type issue
KonvaEventListener will get a NodeEventMap entity, not NodeEventMap Key
This commit is contained in:
parent
9c5abb0a30
commit
55dbae92f0
@ -688,7 +688,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
|||||||
*/
|
*/
|
||||||
on<K extends keyof NodeEventMap>(
|
on<K extends keyof NodeEventMap>(
|
||||||
evtStr: K,
|
evtStr: K,
|
||||||
handler: KonvaEventListener<this, K>
|
handler: KonvaEventListener<this, NodeEventMap[K]>
|
||||||
) {
|
) {
|
||||||
if (arguments.length === 3) {
|
if (arguments.length === 3) {
|
||||||
return this._delegate.apply(this, arguments);
|
return this._delegate.apply(this, arguments);
|
||||||
|
Loading…
Reference in New Issue
Block a user