Commit c4ab4f73 authored by wlxuqu's avatar wlxuqu

优化组件逻辑

parent 7acf3daa
...@@ -162,12 +162,16 @@ export default { ...@@ -162,12 +162,16 @@ export default {
}; };
}, },
watch: { watch: {
src(n) { src: {
if(!n) { immediate: true,
// 如果传入null或者'',或者false,或者undefined,标记为错误状态 handler (n) {
this.isError = true; if(!n) {
} else { // 如果传入null或者'',或者false,或者undefined,标记为错误状态
this.isError = false; this.isError = true;
this.loading = false;
} else {
this.isError = false;
}
} }
} }
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class=""> <view class="">
<view class="u-content" :class="[elId]" :style="{ <view class="u-content" :class="[elId]" :style="{
height: isLongContent && !showMore ? showHeight + 'rpx' : 'auto', height: isLongContent && !showMore ? showHeight + 'rpx' : 'auto',
textIndent: this.textIndent textIndent: textIndent
}"> }">
<slot></slot> <slot></slot>
</view> </view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment