Skip to content

Commit c4ab4f7

Browse files
committed
优化组件逻辑
1 parent 7acf3da commit c4ab4f7

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

uview-ui/components/u-image/u-image.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,16 @@ export default {
162162
};
163163
},
164164
watch: {
165-
src(n) {
166-
if(!n) {
167-
// 如果传入null或者'',或者false,或者undefined,标记为错误状态
168-
this.isError = true;
169-
} else {
170-
this.isError = false;
165+
src: {
166+
immediate: true,
167+
handler (n) {
168+
if(!n) {
169+
// 如果传入null或者'',或者false,或者undefined,标记为错误状态
170+
this.isError = true;
171+
this.loading = false;
172+
} else {
173+
this.isError = false;
174+
}
171175
}
172176
}
173177
},

uview-ui/components/u-read-more/u-read-more.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<view class="">
33
<view class="u-content" :class="[elId]" :style="{
44
height: isLongContent && !showMore ? showHeight + 'rpx' : 'auto',
5-
textIndent: this.textIndent
5+
textIndent: textIndent
66
}">
77
<slot></slot>
88
</view>

0 commit comments

Comments
 (0)