码云推荐 | 基于 vue.js 的移动端组件库 mint-ui

升级版的mint-ui,基于vue.js,可自己拓展组件。

Installation

推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用。

npm i mint-ui -S

# for Vue 1.x

npm i mint-ui@1 -S

Usage

Import all components.

import Vue from 'vue'

import Mint from 'mint-ui';

Vue.use(Mint);

Or import specified component. (Use babel-plugin-component)

import { Cell, Checklist } from 'mint-ui';

Vue.component(Cell.name, Cell);

Vue.component(Checklist.name, Checklist);

Equals to

import Vue from 'vue';

import Mint from 'mint-ui';

import 'mint-ui/lib/style.css';

Vue.use(Mint);

// import specified component

import MtRadio from 'mint-ui/lib/radio';

import 'mint-ui/lib/radio/style.css';

Vue.component(MtRadio.name, MtRadio);

babel-plugin-component

  • Auto import css file
  • Modular import component

Installation

npm i babel-plugin-component -D

Usage

.babelrc

{ "plugins": ["other-plugin", ["component", [ { "libraryName": "mint-ui", "style": true } ]]]

}

CDN

RawGit

  • https://cdn.rawgit.com/ElemeFE/mint-ui/master/lib/index.js
  • https://cdn.rawgit.com/ElemeFE/mint-ui/master/lib/style.css

NPMCDN

  • https://unpkg.com/mint-ui/lib/index.js
  • https://unpkg.com/mint-ui/lib/style.css