提交 | 用户 | 时间
|
314507
|
1 |
import type { App } from 'vue' |
H |
2 |
// 需要全局引入一些组件,如ElScrollbar,不然一些下拉项样式有问题 |
|
3 |
import { ElLoading, ElScrollbar, ElButton } from 'element-plus' |
2307f1
|
4 |
import ElementPlus from 'element-plus' |
D |
5 |
import 'element-plus/dist/index.css' |
314507
|
6 |
|
H |
7 |
const plugins = [ElLoading] |
|
8 |
|
|
9 |
const components = [ElScrollbar, ElButton] |
|
10 |
|
|
11 |
export const setupElementPlus = (app: App<Element>) => { |
|
12 |
plugins.forEach((plugin) => { |
|
13 |
app.use(plugin) |
|
14 |
}) |
|
15 |
|
|
16 |
components.forEach((component) => { |
|
17 |
app.component(component.name, component) |
|
18 |
}) |
2307f1
|
19 |
|
D |
20 |
app.use(ElementPlus) |
314507
|
21 |
} |