element/README.md

106 lines
2.9 KiB
Markdown
Raw Normal View History

2016-09-09 21:40:35 +08:00
# Element
[![Build Status](https://travis-ci.org/ElemeFE/element.svg?branch=master)](https://travis-ci.org/ElemeFE/element)
[![npm package](https://img.shields.io/npm/v/element-ui.svg)](https://www.npmjs.org/package/element-ui)
[![NPM downloads](http://img.shields.io/npm/dm/element-ui.svg)](https://npmjs.org/package/element-ui)
2016-09-23 08:50:27 +08:00
![JS gzip size](http://img.badgesize.io/https://unpkg.com/element-ui@next/lib/index.js?compression=gzip&label=gzip%20size:%20JS)
![CSS gzip size](http://img.badgesize.io/https://unpkg.com/element-ui@next/lib/theme-default/index.css?compression=gzip&label=gzip%20size:%20CSS)
2016-09-09 21:32:31 +08:00
[![Join the chat at https://gitter.im/ElemeFE/element](https://badges.gitter.im/ElemeFE/element.svg)](https://gitter.im/ElemeFE/element?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2016-09-09 21:40:35 +08:00
2016-09-05 12:33:21 +08:00
> Desktop UI elements for Vue.js 2.0.
2016-07-27 14:15:02 +08:00
## Links
- [Home Page](http://element.eleme.io/)
- [Docs](http://element.eleme.io/#/component)
2016-09-03 20:30:59 +08:00
## Install
2016-07-27 14:15:02 +08:00
```shell
2016-09-21 11:27:43 +08:00
npm install element-ui@next -S
2016-07-27 14:15:02 +08:00
```
## Quick Start
use [babel-plugin-component](https://github.com/QingWei-Li/babel-plugin-component)
``` javascript
import Vue from 'vue'
import Element from 'element-ui'
Vue.use(Element)
// or
import {
Select,
Button
// ...
} from 'element-ui'
2016-09-06 12:01:53 +08:00
Vue.component(Select.name, Select)
Vue.component(Button.name, Button)
2016-07-27 14:15:02 +08:00
```
(roughly) to
``` javascript
import Vue from 'vue'
import Element from 'element-ui'
2016-09-07 15:11:50 +08:00
import 'element-ui/lib/theme-default/index.css'
2016-07-27 14:15:02 +08:00
Vue.use(Element)
// or
2016-09-07 15:11:50 +08:00
import Select from 'element-ui/lib/select'
2016-09-12 13:53:45 +08:00
import 'element-ui/lib/theme-default/select.css'
2016-09-07 15:11:50 +08:00
import Button from 'element-ui/lib/button'
2016-09-12 13:53:45 +08:00
import 'element-ui/lib/theme-default/button.css'
2016-07-27 14:15:02 +08:00
2016-09-06 12:01:53 +08:00
Vue.component(Select.name, Select)
Vue.component(Button.name, Button)
2016-07-27 14:15:02 +08:00
```
## babel-plugin-component
.babelrc
```json
{
"plugins": ["xxx", ["component", [
{
"libraryName": "element-ui",
"styleLibraryName": "theme-default"
}
]]]
}
```
2016-09-24 18:09:09 +08:00
## Browser Support
Modern browsers and Internet Explorer 9+.
2016-09-07 15:38:19 +08:00
## Development
Recommend: node >= 4 npm >= 3
2016-09-06 11:51:08 +08:00
```shell
# development => install packages -> build icon etc. -> run webpack
$ npm run dev
2016-09-03 20:30:59 +08:00
2016-09-06 11:51:08 +08:00
# build => build all component
$ npm run dist
2016-09-03 20:30:59 +08:00
```
2016-09-21 11:27:43 +08:00
## Other links
2016-09-23 16:38:35 +08:00
- Starter Kit
- [element-starter](https://github.com/ElementUI/element-starter)
- [element-cooking-starter](https://github.com/ElementUI/element-cooking-starter)
2016-09-21 11:27:43 +08:00
- [Design resources](https://github.com/ElementUI/Resources)
- Boilerplate for bug reports
- [CodePen](https://codepen.io/anon/pen/ozYpNA)
- [JSFiddle](https://jsfiddle.net/gmve9d3p/)
- [Mint UI](https://github.com/ElemeFE/mint-ui) - Mobile UI elements for Vue.js
2016-09-01 14:17:01 +08:00
## Changelog
2016-09-24 20:26:03 +08:00
Detailed changes for each release are documented in the [release notes](https://github.com/ElemeFE/element/releases).
2016-09-01 14:17:01 +08:00
2016-09-07 12:40:16 +08:00
## Contribution
2016-09-07 15:11:50 +08:00
Please make sure to read the [Contributing Guide](https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.md) before making a pull request.
2016-09-07 12:40:16 +08:00
2016-07-27 14:15:02 +08:00
## LICENSE
MIT
2016-09-01 14:17:01 +08:00