Skip to content

Commit

Permalink
feat(dev): add global component types for volar (element-plus#3624)
Browse files Browse the repository at this point in the history
* feat(dev): add global component types for volar

* chore: update README.md
  • Loading branch information
sxzz authored Sep 25, 2021
1 parent ad32cba commit 5faec88
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ $ pnpm gen component-name

Note the `component-name` must be in `kebab-case`, combining words by replacing each space with a dash.

And component type must be added to `packages/element-plus/global.d.ts`.

## Commit template

With command
Expand Down
14 changes: 14 additions & 0 deletions docs/en-US/guide/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ app.use(ElementPlus)
app.mount('#app')
```

#### Volar support

If you use volar, please add the global component type definition to `compilerOptions.types` in `tsconfig.json`.

```json
// tsconfig.json
{
"compilerOptions": {
// ...
"types": ["element-plus/global"]
}
}
```

### On-demand Import

You need to use an additional plugin to import components you used.
Expand Down
File renamed without changes.

0 comments on commit 5faec88

Please sign in to comment.