-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Closed
Labels
Description
Vue version
3.5.12
Link to minimal reproduction
Steps to reproduce
Create a simple directive:
directives/vTest.ts
import type { Directive } from 'vue'
export const vTest: Directive<HTMLElement, string, 'all' | 'none'> = {
beforeMount() {},
}
Import it, not using all the modifiers at once.
App.vue
<template>
<div v-test.all></div>
</template>
<script setup lang="ts">
import { vTest } from './directives/vTest'
</script>
What is expected?
No error.
What is actually happening?
The following error appears (in VSCode), mentioning a "runtime.core.d.ts" type:
Thye issue appears to be here:
Where DirectiveModifiers
maps to Record<K, boolean>
where it should be Partial<Record<K, boolean>>
, since no obligation exists to have any modifier at all, let along all of them at once.
System Info
No response
Any additional comments?
First mentioned in vuejs/language-tools#5080, but marked as an upstream error.
chrisjansky, xioneko, Mini-ghost, mk4arts, roydukkey and 4 more