element-plus 的按需加载

vue create my-app
cd my-app
vue add element-plus


element.js ==> element.ts
// element.ts
import { ElButton } from 'element-plus';

const components = [
  ElButton,
];
// eslint-disable-next-line
export default (app: any) => {
  components.forEach((component) => {
    app.use(component);
  });
};

你可能感兴趣的:(element-plus 的按需加载)