Skip to content

feat(language-core): typed directives in template #4807

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

Merged
merged 8 commits into from
Sep 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update main.vue
  • Loading branch information
johnsoncodehk committed Sep 4, 2024
commit bd0b6e233c6480053fdb38cc5986db36e393d970
18 changes: 9 additions & 9 deletions test-workspace/tsc/passedFixtures/vue3/directives/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { FunctionDirective } from 'vue';
import { exactType } from '../../shared';

declare module 'vue' {
interface GlobalDirectives {
vFoo: FunctionDirective<typeof Comp, (_: number) => void>;
}
interface GlobalDirectives {
vFoo: FunctionDirective<typeof Comp, (_: number) => void>;
}
}

let Comp!: (_: { foo?: string; }) => void;

export default {
directives: {
vBar: {} as FunctionDirective<typeof Comp, (_: string) => void>
}
directives: {
vBar: {} as FunctionDirective<typeof Comp, (_: string) => void>
}
};
</script>

Expand All @@ -23,6 +23,6 @@ let vBaz!: FunctionDirective<typeof Comp, (_: boolean) => void>;

<template>
<Comp v-foo="v => exactType(v, {} as number)" />
<Comp v-bar="v => exactType(v, {} as string)" />
<Comp v-baz="v => exactType(v, {} as boolean)" />
</template>
<Comp v-bar="v => exactType(v, {} as string)" />
<Comp v-baz="v => exactType(v, {} as boolean)" />
</template>
Loading