From e380c23b1cb099d8a0d2b94245ada7c0d5ef5c69 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 3 Jan 2020 18:17:41 +0800 Subject: [PATCH] feat(Image): add loading-icon prop (#5469) --- src/image/README.md | 1 + src/image/README.zh-CN.md | 1 + src/image/demo/index.vue | 62 ++++--------------- src/image/index.js | 6 +- .../test/__snapshots__/index.spec.js.snap | 7 +++ src/image/test/index.spec.js | 10 +++ 6 files changed, 35 insertions(+), 52 deletions(-) diff --git a/src/image/README.md b/src/image/README.md index 61a35fcdf..b175729ab 100644 --- a/src/image/README.md +++ b/src/image/README.md @@ -78,6 +78,7 @@ Vue.use(Lazyload); | lazy-load | Whether to enable lazy load,should register [Lazyload](#/en-US/lazyload) component | *boolean* | `false` | - | | show-error | Whether to show error placeholder | *boolean* | `true` | 2.0.9 | | show-loading | Whether to show loading placeholder | *boolean* | `true` | 2.0.9 | +| loading-icon | Loading icon | *string* | `photo-o` | 2.4.2 | ### fit optional value diff --git a/src/image/README.zh-CN.md b/src/image/README.zh-CN.md index cfc1f9046..7c45f6cdf 100644 --- a/src/image/README.zh-CN.md +++ b/src/image/README.zh-CN.md @@ -104,6 +104,7 @@ Vue.use(Image); | lazy-load | 是否开启图片懒加载,须配合 [Lazyload](#/zh-CN/lazyload) 组件使用 | *boolean* | `false` | - | | show-error | 是否展示图片加载失败提示 | *boolean* | `true` | 2.0.9 | | show-loading | 是否展示图片加载中提示 | *boolean* | `true` | 2.0.9 | +| loading-icon | 加载时提示的图标名称或图片链接,可选值见 [Icon 组件](#/zh-CN/icon) | *string* | `photo-o` | 2.4.2 | ### 图片填充模式 diff --git a/src/image/demo/index.vue b/src/image/demo/index.vue index 5a9fccef4..a56fffee7 100644 --- a/src/image/demo/index.vue +++ b/src/image/demo/index.vue @@ -2,27 +2,14 @@ - + - - + +
{{ fit }}
@@ -30,18 +17,8 @@ - - + +
{{ fit }}
@@ -50,23 +27,14 @@ - +
{{ $t('defaultTip') }}
- +
{{ $t('customTip') }}
@@ -77,20 +45,12 @@ - +
{{ $t('defaultTip') }}
- +
{{ $t('customTip') }}
@@ -133,7 +93,7 @@ export default {