merge: merge master

This commit is contained in:
jiangruowei
2017-03-15 16:31:00 +08:00
50 changed files with 979 additions and 58 deletions

View File

@@ -1,3 +1,13 @@
<style>
@component-namespace demo {
@b field {
.zan-field-wrapper {
padding: 0 10px;
}
}
}
</style>
<script>
export default {
data() {
@@ -38,6 +48,18 @@ export default {
```
:::
### 带border的输入框
传入一个`border`属性。
:::demo 带border的输入框
```html
<div class="zan-field-wrapper">
<zan-field type="text" placeholder="请输入用户名" border></zan-field>
</div>
```
:::
### 禁用的输入框
传入`disabled`属性即可。

View File

@@ -0,0 +1,26 @@
<style>
@component-namespace demo {
@b swipe {
.zan-swipe {
height: 200px;
}
}
}
</style>
## Swipe
### 基础用法
:::demo 基础用法
```html
<zan-swipe>
<zan-swipe-item>
<img src="https://img.yzcdn.cn/upload_files/2017/03/14/FmTPs0SeyQaAOSK1rRe1sL8RcwSY.jpeg?imageView2/2/w/980/h/980/q/75/format/webp" alt="">
</zan-swipe-item>
<zan-swipe-item>
<img src="https://img.yzcdn.cn/upload_files/2017/03/14/FmTPs0SeyQaAOSK1rRe1sL8RcwSY.jpeg?imageView2/2/w/980/h/980/q/75/format/webp" alt="">
</zan-swipe-item>
</zan-swipe>
```
:::

View File

@@ -0,0 +1,54 @@
<style>
.uploader-container {
padding: 5px 15px;
}
</style>
<script>
export default {
methods: {
logContent(file) {
console.log(file)
}
}
};
</script>
## Uploader 组件
### 基础用法
:::demo 基础用法
```html
<div class="uploader-container">
<zan-uploader
:before-read="logContent"
@file-readed="logContent">
</zan-uploader>
</div>
```
:::
### 自定义上传图标
:::demo 自定义上传图标
```html
<div class="uploader-container">
<zan-uploader @file-readed="logContent">
<zan-icon name="camera"></zan-icon>
</zan-uploader>
</div>
```
:::
### API
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------|
| result-type | 读取文件的方式以base64的方式读取以文本的方式读取 | String | 'dataUrl' | 'dataUrl','text' |
| disable | 是否禁用上传,在图片上传期间设置为true禁止用户点击此组件上传图片 | boolean | false | |
| before-read | 读文件之前的钩子,参数为选择的文件,若返回 false 则停止读取文件。 | Function | | |
| file-readed | 文件读完之后出发此事件,参数为{name:'文件名',type:'文件类型',size:'文件大小',content:'读的内容'} | Function | | |
### Slot
| name | 描述 |
|-----------|-----------|
| - | 自定义上传显示图标 |