From 250babecaa6c2fc38c1609fc0b36f947ede4e61d Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 18 Jul 2019 21:01:14 +0800 Subject: [PATCH] [new feature] Image: add loading-placeholder prop (#3893) --- src/image/README.md | 5 ++++- src/image/README.zh-CN.md | 5 +++-- src/image/index.js | 12 ++++++++---- src/image/test/__snapshots__/index.spec.js.snap | 2 ++ src/image/test/index.spec.js | 10 ++++++++++ 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/image/README.md b/src/image/README.md index 6ffb8cee8..67ccd0444 100644 --- a/src/image/README.md +++ b/src/image/README.md @@ -33,6 +33,8 @@ Vue.use(Image); ### Round +Show round image, it may not works at `fit=contain` and `fit=scale-down` + ```html {this.slots('loading') || } diff --git a/src/image/test/__snapshots__/index.spec.js.snap b/src/image/test/__snapshots__/index.spec.js.snap index cfa3f8b71..418dab8bb 100644 --- a/src/image/test/__snapshots__/index.spec.js.snap +++ b/src/image/test/__snapshots__/index.spec.js.snap @@ -24,3 +24,5 @@ exports[`load event 2`] = ` `; + +exports[`loading-placeholder prop 1`] = `
`; diff --git a/src/image/test/index.spec.js b/src/image/test/index.spec.js index f3a493fc8..4f3042429 100644 --- a/src/image/test/index.spec.js +++ b/src/image/test/index.spec.js @@ -101,3 +101,13 @@ test('lazy-load error event', done => { } }); }); + +test('loading-placeholder prop', () => { + const wrapper = mount(Image, { + propsData: { + loadingPlaceholder: false + } + }); + + expect(wrapper).toMatchSnapshot(); +});