types: improve directive hook argument types

This commit is contained in:
Evan You
2020-03-18 12:30:20 -04:00
parent aa4ab39c1a
commit be91b43564
2 changed files with 10 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import {
ObjectDirective,
VNode,
DirectiveHook,
DirectiveBinding,
warn
} from '@vue/runtime-core'
@@ -240,7 +241,7 @@ function callModelHook(
modelToUse = vModelText
}
}
const fn = modelToUse[hook]
const fn = modelToUse[hook] as DirectiveHook
fn && fn(el, binding, vnode, prevVNode)
}