index.ts 445 B

123456789101112131415161718
  1. import type { App } from 'vue'
  2. // 需要全局引入一些组件,如ElScrollbar,不然一些下拉项样式有问题
  3. import { ElLoading, ElScrollbar } from 'element-plus'
  4. const plugins = [ElLoading]
  5. const components = [ElScrollbar]
  6. export const setupElementPlus = (app: App<Element>) => {
  7. plugins.forEach((plugin) => {
  8. app.use(plugin)
  9. })
  10. components.forEach((component) => {
  11. app.component(component.name, component)
  12. })
  13. }