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

36 lines
1.3 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
If you are using CDN, a hello-world page is easy with Element. [Online Demo](https://codepen.io/ziyoung/pen/rRKYpd)
2016-10-28 03:52:43 +00:00
<iframe height="265" style="width: 100%;" scrolling="no" title="Element demo" src="//codepen.io/ziyoung/embed/rRKYpd/?height=265&theme-id=light&default-tab=html" frameborder="no" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/ziyoung/pen/rRKYpd/'>Element demo</a> by hetech
(<a href='https://codepen.io/ziyoung'>@ziyoung</a>) on <a href='https://codepen.io'>CodePen</a>.
</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).