mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-17 11:49:41 +08:00
docs: how to use Element Plus in Nuxt (#11385)
docs: how to use in Nuxt
This commit is contained in:
parent
b7fd75f75a
commit
279bf6d9c5
@ -100,6 +100,25 @@ module.exports = {
|
||||
|
||||
For more bundlers ([Rollup](https://rollupjs.org/), [Vue CLI](https://cli.vuejs.org/)) and configs please reference [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components#installation) and [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import#install).
|
||||
|
||||
#### Nuxt
|
||||
|
||||
For Nuxt users, you only need to install `@element-plus/nuxt`.
|
||||
|
||||
```shell
|
||||
npm install -D @element-plus/nuxt
|
||||
```
|
||||
|
||||
Then add the code below into your config file.
|
||||
|
||||
```ts
|
||||
// nuxt.config.ts
|
||||
export default defineNuxtConfig({
|
||||
modules: ['@element-plus/nuxt'],
|
||||
})
|
||||
```
|
||||
|
||||
Refer to the [docs](https://github.com/element-plus/element-plus-nuxt#readme) for how to configure it.
|
||||
|
||||
### Manually import
|
||||
|
||||
Element Plus provides out of box [Tree Shaking](https://webpack.js.org/guides/tree-shaking/)
|
||||
@ -149,6 +168,9 @@ import { ElMessage } from 'element-plus'
|
||||
## Starter Template
|
||||
|
||||
We provide a [Vite Template](https://github.com/element-plus/element-plus-vite-starter).
|
||||
|
||||
For Nuxt users we have a [Nuxt Template](https://github.com/element-plus/element-plus-nuxt-starter).
|
||||
|
||||
For Laravel users we have a [Laravel Template](https://github.com/element-plus/element-plus-in-laravel-starter).
|
||||
|
||||
## Global Configuration
|
||||
|
Loading…
Reference in New Issue
Block a user