1. 模块安装
npm i mint-ui -S
npm install babel-plugin-component -D
2. 修改配置babel.config.js
module.exports = {
presets: ["@vue/app"],
plugins:[
[
"component",
{
"libraryName": "mint-ui",
"style": true
}
]
]
};
3. 使用
main.js 导入
import { Button } from 'mint-ui'
Vue.component(Button.name, Button);
组件使用
<mt-button type="danger">danger</mt-button>
<mt-button type="primary">primary</mt-button>
本文介绍了如何通过npm安装Mint-UI库,配置babel.config.js以引入Vue组件,并在main.js中导入并使用Button等组件。步骤包括模块安装、配置文件设置和组件实例化。

1693

被折叠的 条评论
为什么被折叠?



