好车主 UMC-UI 组件库
Ultra Mature Car - UI . You will love it.
安装使用
推(qiang)荐(zhi)使用 npm 安装
注意: 直接使用 cnpm 可能会导致依赖不正确。强烈建议给 npm 设置 taobao 的 registry。
npm config set registry https://registry.npm.taobao.orgnpm install umc-ui --save // 或者使用 yarnyarn config set registry https://registry.npm.taobao.orgyarn add umc-ui
✨ 强烈推荐使用 umc-cli 快速初始化项目
umc-cli 可以快速搭建项目脚手架,内置了 umc-ui 组件库
脚手架提供了丰富的功能,热更新,es6,http代理,eslint,zip打包,生成tag 等。
了解更多脚手架信息: *** 文档稍后完成 ***
// 安装命令行工具npm install umc-cli -g // 快速初始化项目umc generate projectName // 进入项目目录cd projectName // 安装依赖// 先指定 sass 二进制文件下载源set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/npm install // 或者 yarn // 运行开发调试环境npm run dev // for develop // 运行打包构建npm run make-test // for build testnpm run make-prod // for build prodnpm run pack-test // for zip testnpm run pack-prod // for zip prod and generate git-tag
因脚手架中使用了 node-sass , 推荐一个方法可以快速安装
set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/npm install node-sass // or yarn add node-sass
或者使用代理
npm config set proxy http://127.0.0.1:1080npm i node-sass // 下载完成后删除 http 代理npm config delete proxy
调用示例
推荐按需打包,会大大缩小包的体积。mu 是组件前缀
注意:只需将 umc-ui
替换成 $umc-ui/组件名
就可以只打包单个组件
// 整个组件都会打包 // 只会打包 MuRows,MuRow 组件
------ EOF ------