element/examples/docs/en-US/installation.md

33 lines
1.1 KiB
Markdown
Raw Normal View History

2016-11-13 03:58:45 +00:00
## Installation
2016-10-28 03:52:43 +00:00
2016-11-13 03:58:45 +00:00
### npm
2016-11-26 21:42:33 +00:00
Installing with npm is recommended and it works seamlessly with [webpack](https://webpack.js.org/).
2016-10-28 03:52:43 +00:00
```shell
2017-10-26 04:50:28 +00:00
npm i element-ui -S
2016-10-28 03:52:43 +00:00
```
### CDN
2017-10-26 04:50:28 +00:00
Get the latest version from [unpkg.com/element-ui](https://unpkg.com/element-ui/) , and import JavaScript and CSS file in your page.
2016-10-28 03:52:43 +00:00
```html
2016-11-13 03:58:45 +00:00
<!-- import CSS -->
2017-10-26 04:50:28 +00:00
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
2016-11-13 03:58:45 +00:00
<!-- import JavaScript -->
2017-10-26 04:50:28 +00:00
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
2016-10-28 03:52:43 +00:00
```
2017-11-02 03:27:12 +00:00
:::tip
We recommend our users to lock Element's version when using CDN. Please refer to [unpkg.com](https://unpkg.com) for more information.
:::
2016-10-28 03:52:43 +00:00
### Hello world
2017-10-26 04:50:28 +00:00
If you are using CDN, a hello-world page is easy with Element. [Online Demo](https://jsfiddle.net/hzfpyvg6/14/)
2016-10-28 03:52:43 +00:00
<iframe width="100%" height="600" src="//jsfiddle.net/hzfpyvg6/1213/embedded/html,result/" allowpaymentrequest allowfullscreen="allowfullscreen" frameborder="0"></iframe>
2018-08-02 06:33:51 +00:00
If you are using npm and wish to apply webpack, please continue to the next page: [Quick Start](/#/en-US/component/quickstart).