首页 > 其他分享 >element按需引入

element按需引入

时间:2022-11-03 21:22:05浏览次数:58  
标签:Pagination plugin babel component element ui 引入

  1. 安装elementUi组件库 
    1. npm i element-ui -S
  2. 安装 babel-plugin-component
    1.   
      npm install babel-plugin-component -D
  3. 修改babel.config.js文件

 

module.exports = {
  presets: ["@vue/cli-plugin-babel/preset", ["@babel/preset-env", { modules: false }]],
  plugins: [
    [
      "component",
      {
        libraryName: "element-ui",
        styleLibraryName: "theme-chalk",
      },
    ],
  ],
};

 

  4.在mian.js中引入  

import "element-ui/lib/theme-chalk/index.css";

import { Pagination } from "element-ui";

Vue.use(Pagination);

 

标签:Pagination,plugin,babel,component,element,ui,引入
From: https://www.cnblogs.com/czwhandsome/p/16855878.html

相关文章