[improvement] Toast: optimize image icon display (#3895)

This commit is contained in:
neverland
2019-07-19 09:55:42 +08:00
committed by GitHub
parent 7893399fb0
commit dc0fba3be3
8 changed files with 15 additions and 22 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ Vue.use(Lazyload);
| round | Whether to be round | `boolean` | `false` | - |
| lazy-load | Whether to enable lazy loadshould register [Lazyload](#/en-US/lazyload) component | `boolean` | `false` | - |
| show-error | Whether to show error placeholder | `boolean` | `true` |
| loading-placeholder | Whether to show loading placeholder | `boolean` | `true` |
| show-loading | Whether to show loading placeholder | `boolean` | `true` |
### fit optional value
+3 -3
View File
@@ -96,12 +96,12 @@ Vue.use(Image);
| src | 图片链接 | `string` | - | - |
| fit | 图片填充模式 | `string` | `fill` | - |
| alt | 替代文本 | `string` | - | - |
| width | 宽度,默认单位为 px | `string | number` | - | - |
| height | 高度,默认单位为 px | `string | number` | - | - |
| width | 宽度,默认单位为`px` | `string | number` | - | - |
| height | 高度,默认单位为`px` | `string | number` | - | - |
| round | 是否显示为圆形 | `boolean` | `false` | - |
| lazy-load | 是否开启图片懒加载,须配合 [Lazyload](#/zh-CN/lazyload) 组件使用 | `boolean` | `false` | - |
| show-error | 是否展示图片加载失败提示 | `boolean` | `true` | 2.0.9 |
| loading-placeholder | 是否展示图片加载中提示 | `boolean` | `true` | 2.0.9 |
| show-loading | 是否展示图片加载中提示 | `boolean` | `true` | `2.0.9` |
### 图片填充模式
+2 -2
View File
@@ -16,7 +16,7 @@ export default createComponent({
type: Boolean,
default: true
},
loadingPlaceholder: {
showLoading: {
type: Boolean,
default: true
}
@@ -99,7 +99,7 @@ export default createComponent({
},
renderPlaceholder() {
if (this.loading && this.loadingPlaceholder) {
if (this.loading && this.showLoading) {
return (
<div class={bem('loading')}>
{this.slots('loading') || <Icon name="photo-o" size="22" />}
@@ -25,6 +25,6 @@ exports[`load event 2`] = `
</div>
`;
exports[`loading-placeholder prop 1`] = `<div class="van-image"><img class="van-image__img"></div>`;
exports[`show-loading prop 1`] = `<div class="van-image"><img class="van-image__img"></div>`;
exports[`show-error prop 1`] = `<div class="van-image"></div>`;
+2 -2
View File
@@ -102,10 +102,10 @@ test('lazy-load error event', done => {
});
});
test('loading-placeholder prop', () => {
test('show-loading prop', () => {
const wrapper = mount(Image, {
propsData: {
loadingPlaceholder: false
showLoading: false
}
});