Skip to content

Commit

Permalink
Image: Add big Image preview feature (#16333) (#16605)
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyCao authored and ziyoung committed Jul 25, 2019
1 parent 29838ea commit 1b1c1be
Show file tree
Hide file tree
Showing 10 changed files with 624 additions and 3 deletions.
30 changes: 30 additions & 0 deletions examples/docs/en-US/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,34 @@ Besides the native features of img, support lazy load, custom placeholder and lo
```
:::

### Image Preview

:::demo allow big image preview by setting `previewSrcList` prop.
```html
<div class="demo-image__preview">
<el-image
style="width: 100px; height: 100px"
:src="url"
:preview-src-list="srcList">
</el-image>
</div>

<script>
export default {
data() {
return {
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
srcList: [
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
]
}
}
}
</script>
```
:::

### Attributes
| Attribute | Description | Type | Accepted values | Default |
|---------- |-------- |---------- |------------- |-------- |
Expand All @@ -117,6 +145,8 @@ Besides the native features of img, support lazy load, custom placeholder and lo
| referrer-policy | Native referrerPolicy | string | - | - |
| lazy | Whether to use lazy load | boolean || false |
| scroll-container | The container to add scroll listener when using lazy load | string / HTMLElement || The nearest parent container whose overflow property is auto or scroll |
| preview-src-list | allow big image preview | Array || - |
| z-index | set image preview z-index | Number || 2000 |

### Events
| Event Name | Description | Parameters |
Expand Down
30 changes: 30 additions & 0 deletions examples/docs/es/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,34 @@ Además de las características nativas de img, soporte de carga perezosa, marca
```
:::

### Image Preview

:::demo allow big image preview by setting `previewSrcList` prop.
```html
<div class="demo-image__preview">
<el-image
style="width: 100px; height: 100px"
:src="url"
:preview-src-list="srcList">
</el-image>
</div>

<script>
export default {
data() {
return {
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
srcList: [
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
]
}
}
}
</script>
```
:::

### Atributos
| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
|---------- |-------- |---------- |------------- |-------- |
Expand All @@ -119,6 +147,8 @@ Además de las características nativas de img, soporte de carga perezosa, marca
| referrer-policy | referrerPolicy nativo | string | - | - |
| lazy | si se usara lazy load | boolean || false |
| scroll-container | El contenedor para añadir el scroll listener cuando se utiliza lazy load | string / HTMLElement || El contenedor padre más cercano cuya propiedad de desbordamiento es auto o scroll |
| preview-src-list | allow big image preview | Array || - |
| z-index | set image preview z-index | Number || 2000 |

### Eventos
| Nombre del evento | Descripción | Parámetros |
Expand Down
30 changes: 30 additions & 0 deletions examples/docs/fr-FR/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,34 @@ En plus des propriétés natives de img, ce composant supporte le lazy loading,
```
:::

### Image Preview

:::demo allow big image preview by setting `previewSrcList` prop.
```html
<div class="demo-image__preview">
<el-image
style="width: 100px; height: 100px"
:src="url"
:preview-src-list="srcList">
</el-image>
</div>

<script>
export default {
data() {
return {
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
srcList: [
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
]
}
}
}
</script>
```
:::

### Attributs
| Attribut | Description | Type | Valeurs acceptées | Défaut |
|---------- |-------- |---------- |------------- |-------- |
Expand All @@ -118,6 +146,8 @@ En plus des propriétés natives de img, ce composant supporte le lazy loading,
| referrer-policy | Attribut referrerPolicy natif.| string | - | - |
| lazy | Si le lazy loading doit être utilisé. | boolean || false |
| scroll-container | Le conteneur auquel ajouter le listener du scroll en mode lazy loading. | string / HTMLElement || Le conteneur parent le plus proche avec la propriété overflow à auto ou scroll. |
| preview-src-list | allow big image preview | Array || - |
| z-index | set image preview z-index | Number || 2000 |

### Évènements
| Nom | Description | Paramètres |
Expand Down
30 changes: 30 additions & 0 deletions examples/docs/zh-CN/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,34 @@
```
:::

### 大图预览

:::demo 可通过 `previewSrcList` 开启预览大图的功能。
```html
<div class="demo-image__preview">
<el-image
style="width: 100px; height: 100px"
:src="url"
:preview-src-list="srcList">
</el-image>
</div>

<script>
export default {
data() {
return {
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
srcList: [
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
]
}
}
}
</script>
```
:::

### Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
Expand All @@ -117,6 +145,8 @@
| referrer-policy | 原生 referrerPolicy | string | - | - |
| lazy | 是否开启懒加载 | boolean || false |
| scroll-container | 开启懒加载后,监听 scroll 事件的容器 | string / HTMLElement || 最近一个 overflow 值为 auto 或 scroll 的父元素 |
| preview-src-list | 开启图片预览功能 | Array || - |
| z-index | 设置图片预览的 z-index | Number || 2000 |

### Events
| 事件名称 | 说明 | 回调参数 |
Expand Down
Loading

0 comments on commit 1b1c1be

Please sign in to comment.