Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directive modifier validation is wrong #5080

Open
ludwig801 opened this issue Dec 24, 2024 · 1 comment
Open

Directive modifier validation is wrong #5080

ludwig801 opened this issue Dec 24, 2024 · 1 comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first upstream: core

Comments

@ludwig801
Copy link

Vue - Official extension or vue-tsc version

2.2.0

VSCode version

1.96.2

Vue version

3.5.12

TypeScript version

5.7.2

System Info

No response

package.json dependencies

No response

Steps to reproduce

Create a simple directive and type it:

vTest.ts

import type { ObjectDirective } from 'vue'

export const vTest: ObjectDirective<HTMLElement, string, 'all' | 'none'> = {}

Import the directive and use one of the modifiers:

<template>
  <div v-test.all></div>
</template>

<script setup lang="ts">
import { vTest } from './directives/vTest'
</script>

What is expected?

No error. Everything is used correctly.

What is actually happening?

The following error is being issued:
image

Which relates to runtime.core.d.ts:
image

Which expects DirectiveModifiers to be a Record<K, boolean> - i.e.: a record containing all modifiers as keys.
I understand this should be Partial<Record<K, boolean>>, no?

Link to minimal reproduction

No response

Any additional comments?

No response

@KazariEX KazariEX added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first upstream: core and removed pending triage labels Dec 24, 2024
@KazariEX
Copy link
Collaborator

Yes, it should be a upstream issue, feel free to pr for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first upstream: core
Projects
None yet
Development

No branches or pull requests

2 participants