You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/component-meta/README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,33 @@ const meta = checker.getComponentMeta(componentPath);
42
42
43
43
This meta contains really useful stuff like component props, slots, events and more. You can refer to its [type definition](https://github.com/vuejs/language-tools/blob/master/packages/component-meta/lib/types.ts) for more details.
44
44
45
+
### Extracting component name and description
46
+
47
+
The component meta also includes `name` and `description` fields at the root level:
48
+
49
+
-**`name`**: Extracted from the `name` property in the component options (for Options API components)
50
+
-**`description`**: Extracted from JSDoc comments above the component export (for TypeScript/JavaScript files)
> JSDoc comments on `export default` statements in Vue SFCs (`.vue` files) are not currently supported due to limitations in how TypeScript processes the virtual files generated from SFCs.
71
+
45
72
### Extracting prop meta
46
73
47
74
`vue-component-meta` will automatically extract the prop details like its name, default value, is required or not, etc. Additionally, you can even write prop description in source code via [JSDoc](https://jsdoc.app/) comment for that prop.
0 commit comments