-
-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(language-core): typed directives in template (#4807)
* feat: typed directives in template * fix: compatibility * format * Update main.vue * Update globalTypes.ts * fixes --------- Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
- Loading branch information
1 parent
408dca1
commit 410f929
Showing
7 changed files
with
79 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
test-workspace/tsc/passedFixtures/vue3/directives/option.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts"> | ||
import { FunctionDirective } from 'vue'; | ||
import { exactType } from '../../shared'; | ||
let Comp!: (_: { foo?: string; }) => void; | ||
export default { | ||
directives: { | ||
vBaz: {} as FunctionDirective<typeof Comp, (_: string) => void> | ||
} | ||
}; | ||
</script> | ||
|
||
<script setup lang="ts"> | ||
</script> | ||
|
||
<template> | ||
<Comp v-baz="v => exactType(v, {} as string)" /> | ||
</template> |