mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-11-30 11:17:38 +08:00
doc: add installation
This commit is contained in:
parent
9cec78ce04
commit
c4463231bd
53
examples/docs/zh-cn/installation.md
Normal file
53
examples/docs/zh-cn/installation.md
Normal file
@ -0,0 +1,53 @@
|
||||
## 安装
|
||||
|
||||
### npm 安装
|
||||
推荐使用 npm 的方式安装,它能更好的和 [webpack](https://webpack.js.org/) 打包工具配合使用。
|
||||
|
||||
```shell
|
||||
npm i element-ui@next -D
|
||||
```
|
||||
**由于当前还处于 rc 阶段,所以仍然需要通过 @next 的方式获取最新版本。**
|
||||
|
||||
### CDN
|
||||
目前可以通过 [unpkg.com/element-ui](https://unpkg.com/element-ui@next/) 获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。
|
||||
|
||||
```html
|
||||
<!-- 引入样式 -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.0.0-rc.8/lib/theme-default/index.css">
|
||||
<!-- 引入组件库 -->
|
||||
<script src="https://unpkg.com/element-ui@1.0.0-rc.8/lib/index.js"></script>
|
||||
```
|
||||
|
||||
### Hello world
|
||||
通过 cdn 的方式我们可以很容易的使用 Element 写一个 Hello world 页面。[在线演示](http://codepen.io/QingWei-Li/pen/vXwJrY)
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<!-- 引入样式 -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.0.0-rc.8/lib/theme-default/index.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<el-button @click.native="visible = true">按钮</el-button>
|
||||
<el-dialog v-model="visible" title="Hello world">
|
||||
<p>欢迎使用 Element</p>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 先引入 Vue -->
|
||||
<script src="https://unpkg.com/vue@2.0.3/dist/vue.js"></script>
|
||||
<!-- 引入组件库 -->
|
||||
<script src="https://unpkg.com/element-ui@1.0.0-rc.8/lib/index.js"></script>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: function() {
|
||||
return { visible: false }
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
```
|
@ -2,6 +2,9 @@
|
||||
{
|
||||
"name": "安装指南",
|
||||
"children": [{
|
||||
"path": "/installation",
|
||||
"name": "安装"
|
||||
},{
|
||||
"path": "/quickstart",
|
||||
"name": "快速上手"
|
||||
}, {
|
||||
|
Loading…
Reference in New Issue
Block a user