Skip to content

Commit

Permalink
fix(Loading): add prop minHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
vvpvvp committed Jul 16, 2018
1 parent a718570 commit 7228d0e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
7 changes: 7 additions & 0 deletions doc/components/component/data/view/loading.vue
Expand Up @@ -26,6 +26,13 @@
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>minHeight</td>
<td>最小高度</td>
<td>Number</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>loading</td>
<td>loading状态</td>
Expand Down
6 changes: 3 additions & 3 deletions doc/components/demos/dataview/loading1.vue
@@ -1,11 +1,11 @@
<template>
<div>
<p v-height="40"><h-switch v-model="loading">切换状态</h-switch></p>
<p v-height="40"><h-switch v-model="loading">change loading</h-switch></p>
<div>
<div style="padding:100px 0;" v-bg-color:gray4 class="text-center">
内容
content
</div>
<Loading text="测试" :loading="loading"></Loading>
<Loading text="Loading" :loading="loading"></Loading>
</div>
</div>
</template>
Expand Down
7 changes: 7 additions & 0 deletions doc/components_en/component/data/view/loading.vue
Expand Up @@ -26,6 +26,13 @@
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>minHeight</td>
<td>minHeight of loading</td>
<td>Number</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>loading</td>
<td>Loading status</td>
Expand Down
5 changes: 3 additions & 2 deletions src/components/loading/loading.vue
Expand Up @@ -17,7 +17,8 @@ export default {
type: Boolean,
default: false
},
text: String
text: String,
minHeight: Number
},
data() {
return {
Expand All @@ -40,7 +41,7 @@ export default {
parent.style.position = 'relative';
this.isSetStyle = true;
}
parent.style.minHeight = '50px';
parent.style.minHeight = this.minHeight ? `${this.minHeight}px` : '50px';
});
} else if (this.isSetStyle) {
this.$nextTick(() => {
Expand Down

0 comments on commit 7228d0e

Please sign in to comment.