Vue 2.7 directive type error

This issue has been tracked since 2022-09-20.

Version

2.7.10

Steps to reproduce

import Vue, { type ObjectDirective } from 'vue'

declare const vFoo: ObjectDirective<
    any,
    {
        foobar: string;
    }
>;
Vue.directive('foo', vFoo);

What is expected?

No type error

What is actually happening?

Argument of type 'ObjectDirective<any, { foobar: string; }>' is not assignable to parameter of type 'DirectiveOptions | DirectiveFunction | undefined'
idleRain wrote this answer on 2022-09-30

不明觉厉

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-10-03
Star Count 199770
Watcher Count 6094
Fork Count 32877
Issue Count 590

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date