安装

首先需要babel-plugin-component

npm install babel-plugin-component -D 

配置

然后在babel.config.js中配置

module.exports = {
  presets: ["@vue/cli-plugin-babel/preset"],
  plugins: [
       [
      "component",
      {
        libraryName: "mint-ui",
        style: true,
      }
    ],
  ]
};

使用

main.js中使用

import { Swipe, SwipeItem } from "mint-ui";