这是 vue
框架自带的接口定义
export declare interface DirectiveBinding<V = any> {
instance: ComponentPublicInstance | null;
value: V;
oldValue: V | null;
arg?: string;
modifiers: DirectiveModifiers;
dir: ObjectDirective<any, V>;
}
我定义了如下一个函数
interface MyInterface{
value:Function
}
const focus = (data:这里怎么写?)=>{
data.value() // 其中我的 value 必须要传一个函数
}
我想用我的 MyInterface
覆盖 DirectiveBinding
的 value
type MyInterface<T = any> = Omit<DirectiveBinding<T>, 'value'> & {value: Function}