Skip to content

Commit

Permalink
feat: piui优化
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhenfei committed Nov 14, 2020
1 parent 60f6d63 commit e72b861
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions components/pi-img/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/>
<view class="pi-abso-center">
<!-- 加载中 -->
<template v-if="loading">
<template v-if="src && loading">
<slot v-if="$slots.loading" name="loading" />
<pi-loading
v-else
Expand All @@ -27,7 +27,7 @@
/>
</template>
<!-- 加载失败 -->
<template v-if="error">
<template v-if="src && error">
<slot v-if="$slots.error" name="error" />
<view class="pi-icon-pic" />
</template>
Expand Down Expand Up @@ -199,10 +199,13 @@ export default {
this.$emit('click', e)
}, 200),
handleError() {
console.log(TAG, '图片加载失败')
this.error = true
this.loading = false
this.$emit('load')
},
handleLoad() {
console.log(TAG, '图片加载成功')
this.error = false
this.loading = false
this.$emit('load')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sadais-piui",
"version": "1.0.7",
"version": "1.0.8",
"description": "piui组件库",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit e72b861

Please sign in to comment.