-
-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(component-meta): allow documenting components in .ts files (#1634)
Co-authored-by: johnsoncodehk <[email protected]>
- Loading branch information
1 parent
9d70df7
commit 23c2500
Showing
5 changed files
with
113 additions
and
42 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
10 changes: 10 additions & 0 deletions
10
packages/vue-test-workspace/vue-component-meta/ts-component/PropDefinitions.ts
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,10 @@ | ||
export interface MyProps { | ||
/** | ||
* string foo | ||
*/ | ||
foo: string, | ||
/** | ||
* optional number bar | ||
*/ | ||
bar?: number, | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/vue-test-workspace/vue-component-meta/ts-component/component.ts
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,6 @@ | ||
import { h, defineComponent } from "vue"; | ||
import { MyProps } from "./PropDefinitions"; | ||
|
||
export default defineComponent((props: MyProps) => { | ||
return h('pre', JSON.stringify(props, null, 2)); | ||
}); |
5 changes: 5 additions & 0 deletions
5
packages/vue-test-workspace/vue-component-meta/ts-named-export/component.ts
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,5 @@ | ||
import { defineComponent } from "vue"; | ||
|
||
export const Foo = defineComponent((_: { foo: string; }) => { }); | ||
|
||
export const Bar = defineComponent((_: { bar?: number; }) => { }); |