[Doc] new theme

This commit is contained in:
陈嘉涵
2019-05-15 20:53:04 +08:00
parent 3cae4288f2
commit d0f4169c86
130 changed files with 1460 additions and 1147 deletions
+8 -6
View File
@@ -1,4 +1,4 @@
## ImagePreview
# ImagePreview
### Install
@@ -8,9 +8,9 @@ import { ImagePreview } from 'vant';
Vue.use(ImagePreview);
```
### Usage
## Usage
#### Basic Usage
### Basic Usage
```javascript
ImagePreview([
@@ -19,7 +19,7 @@ ImagePreview([
]);
```
#### Custom config
### Custom config
```javascript
ImagePreview({
@@ -34,7 +34,7 @@ ImagePreview({
});
```
#### Async Close
### Async Close
```javascript
const instance = ImagePreview({
@@ -50,7 +50,7 @@ setTimeout(() => {
}, 1000);
```
#### Component Call
### Component Call
```html
<van-image-preview
@@ -83,6 +83,8 @@ export default {
}
```
## API
### Options
| Attribute | Description | Type | Default |
+9 -7
View File
@@ -1,6 +1,6 @@
## ImagePreview 图片预览
# ImagePreview 图片预览
### 使用指南
### 引入
`ImagePreview`和其他组件不同,不是通过HTML结构的方式来使用,而是通过函数调用的方式。使用前需要先引入它。
@@ -10,9 +10,9 @@ import { ImagePreview } from 'vant';
Vue.use(ImagePreview);
```
### 代码演示
## 代码演示
#### 基础用法
### 基础用法
直接传入图片数组,即可展示图片预览
@@ -23,7 +23,7 @@ ImagePreview([
]);
```
#### 传入配置项
### 传入配置项
通过传入配置对象,可以指定初始图片的位置、监听关闭事件
@@ -40,7 +40,7 @@ ImagePreview({
});
```
#### 异步关闭
### 异步关闭
通过`asyncClose`属性可以开启异步关闭,开启后异步关闭后,只能通过实例上的 close 方法关闭图片预览
@@ -58,7 +58,7 @@ setTimeout(() => {
}, 1000);
```
#### 组件调用
### 组件调用
如果需要在图片预览内嵌入组件或其他自定义内容,可以使用组件调用的方式,调用前需要通过 `Vue.use` 注册组件
@@ -93,6 +93,8 @@ export default {
}
```
## API
### Options
通过函数调用 `ImagePreview` 时,支持传入以下选项: