Comparing version
{ | ||
"name": "flyme-ui", | ||
"version": "0.1.3", | ||
"description": "一套基于 Vue.js 的移动端 UI 组件库", | ||
"version": "0.2.0", | ||
"description": "一套基于 Vue.js 的响应式移动端 UI 组件库", | ||
"main": "src/index.js", | ||
"scripts": {}, | ||
"scripts": { | ||
"test": "webpack-dev-server --progress --config build/webpack.dev.js", | ||
"start": "rd/s/q demo && webpack --progress --config build/webpack.demo.js" | ||
}, | ||
"repository": { | ||
@@ -23,5 +26,16 @@ "type": "git", | ||
"css-loader": "^0.28.0", | ||
"html-webpack-plugin": "^2.28.0", | ||
"svg-sprite-loader": "^0.3.0", | ||
"vue": "^2.2.6", | ||
"vue-loader": "^11.3.4", | ||
"vue-router": "^2.4.0", | ||
"vue-style-loader": "^3.0.0", | ||
"webpack": "^2.4.1" | ||
} | ||
"vue-template-compiler": "^2.2.6", | ||
"webpack": "^2.4.1", | ||
"webpack-dev-server": "^2.4.2", | ||
"webpack-merge": "^4.1.0" | ||
}, | ||
"files": [ | ||
"src" | ||
] | ||
} |
@@ -5,42 +5,32 @@ # Flyme UI | ||
> 一套基于 Vue.js 的移动端 UI 组件库 | ||
> 一套基于 Vue.js 的响应式移动端 UI 组件库 | ||
## 安装 | ||
## 使用 | ||
[API 文档](https://fedesigner.gitbooks.io/flyme/content/doc/install.html) | ||
[在线 Demo](https://fedesigner.github.io/flyme/demo) | ||
## 开发 | ||
安装依赖: | ||
``` | ||
npm install flyme-ui --save-dev | ||
npm install | ||
``` | ||
## 示例 | ||
运行 Demo: | ||
```html | ||
<!-- vue 单文件组件 --> | ||
<template> | ||
... | ||
<fm-icon :size="18" color="#f12528" id="location"></fm-icon> | ||
... | ||
</template> | ||
<script> | ||
// 建议以 fm 为前缀进行重命名 | ||
import { icon as fmIcon } from 'flyme-ui'; | ||
export default { | ||
components: { | ||
fmIcon, | ||
... | ||
}, | ||
... | ||
} | ||
</script> | ||
``` | ||
npm test | ||
``` | ||
## 组件 | ||
在浏览器中访问: | ||
[Header 标题栏](doc/header.md) | ||
``` | ||
http://localhost:8080/ | ||
``` | ||
[Icon 图标](doc/icon.md) | ||
[Tag 标签](doc/tag.md) | ||
## 贡献 | ||
在任何形式的参与前,请先阅读[贡献指南](CONTRIBUTING.md)。如果你希望参与贡献,欢迎 Pull Request,或给我们报告 Bug。 |
@@ -1,23 +0,2 @@ | ||
import iArrow from './svg/arrow.svg'; | ||
import iBack from './svg/back.svg'; | ||
import iHeart from './svg/heart.svg'; | ||
import iHeartO from './svg/heart-o.svg'; | ||
import iLocation from './svg/location.svg'; | ||
import iTelephone from './svg/telephone.svg'; | ||
import iTick from './svg/tick.svg'; | ||
import iTrash from './svg/trash.svg'; | ||
import iTriangle from './svg/triangle.svg'; | ||
import iVolume from './svg/volume.svg'; | ||
export default { | ||
'arrow': iArrow, | ||
'back': iBack, | ||
'heart': iHeart, | ||
'heart-o': iHeartO, | ||
'location': iLocation, | ||
'telephone': iTelephone, | ||
'tick': iTick, | ||
'trash': iTrash, | ||
'triangle': iTriangle, | ||
'volume': iVolume | ||
} | ||
import Icon from './icon.vue'; | ||
export default Icon; |
@@ -1,9 +0,44 @@ | ||
import header from './component/header/header.vue'; | ||
import icon from './component/icon/icon.vue'; | ||
import tag from './component/tag/tag.vue'; | ||
// 公共组件 | ||
import Button from './component/button'; | ||
import Header from './component/header'; | ||
import Icon from './component/icon'; | ||
import List from './component/list'; | ||
import Menu from './component/menu'; | ||
import Switch from './component/switch'; | ||
import Tag from './component/tag'; | ||
export { | ||
header, | ||
icon, | ||
tag | ||
// 实例方法 | ||
import Toast from './component/toast'; | ||
import Waiting from './component/waiting'; | ||
// 自定义指令 | ||
import Loading from './component/loading'; | ||
const flyme = { | ||
Button, | ||
Header, | ||
Icon, | ||
List: List.List, | ||
ListItem: List.ListItem, | ||
Menu, | ||
SwitchList: List.SwitchList, | ||
Switch, | ||
Tag | ||
} | ||
export default { | ||
install(Vue, options) { | ||
// 自动注册组件 | ||
Object.keys(flyme).forEach((key) => { | ||
Vue.component(`fm${key}`, flyme[key]); | ||
}); | ||
// 添加实例方法 | ||
Vue.prototype.$toast = Toast; | ||
Vue.prototype.$waiting = Waiting; | ||
// 添加自定义指令 | ||
Vue.directive('loading', Loading); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35328
34.38%143
410.71%14
133.33%31
-8.82%35
-22.22%