docs(guide): remove app.config.globalProperties.$ELEMENT (#5133)

This commit is contained in:
C.Y.Kun 2022-01-05 03:44:08 +08:00 committed by GitHub
parent 594df35726
commit 9128d631ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,16 +175,29 @@ app.use(ElementPlus, { size: 'small', zIndex: 3000 })
On-demand:
```ts
import { createApp } from 'vue'
import { ElButton } from 'element-plus'
import App from './App.vue'
```vue
<template>
<el-config-provider :size="size" :zIndex="zIndex">
<app />
</el-config-provider>
</template>
const app = createApp(App)
app.config.globalProperties.$ELEMENT = {
// options
<script>
import { defineComponent } from 'vue'
import { ElConfigProvider } from 'element-plus'
export default defineComponent({
components: {
ElConfigProvider,
},
setup() {
return {
size: 3000,
size: 'small',
}
app.use(ElButton)
},
})
</script>
```
## Using Nuxt.js