Skip to content

Commit c2b756b

Browse files
dpp0507007insummer
authored andcommitted
fix: 修改loading组件,支持指定区域
1 parent 2e653be commit c2b756b

File tree

7 files changed

+29
-20
lines changed

7 files changed

+29
-20
lines changed

dist/loading/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ Component({
1515
type: String,
1616
value: '1'
1717
},
18-
bgColor: String,
18+
bgColor: {
19+
type: String,
20+
value: '#fff'
21+
},
1922
zIndex:{
20-
type:String,
21-
value: '776'
23+
type: Number,
24+
value: 776
2225
},
2326
// 类型
2427
type: {

dist/loading/index.wxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
</view>
3737
</view>
3838

39-
<view wx:if="{{show && !fullScreen}}" style="position: relative">
39+
<view wx:if="{{!fullScreen}}" style="position: relative">
4040
<slot name="content"/>
41-
<view class="inner-loading-container" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}"></view>
42-
<view class="l-class loading-icon-container">
41+
<view wx:if="{{show}}" class="inner-loading-container" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}"></view>
42+
<view wx:if="{{show}}" class="l-class loading-icon-container" style="z-index:{{zIndex + 1}}">
4343
<view class="{{type + '-spinner'}} {{type=='change'||custom?'':'spinner-' + type + '-' + size}}">
4444
<block wx:if="{{custom}}">
4545
<slot />

examples/dist/loading/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ Component({
1515
type: String,
1616
value: '1'
1717
},
18-
bgColor: String,
18+
bgColor: {
19+
type: String,
20+
value: '#fff'
21+
},
1922
zIndex:{
20-
type:String,
21-
value: '776'
23+
type: Number,
24+
value: 776
2225
},
2326
// 类型
2427
type: {

examples/dist/loading/index.wxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
</view>
3737
</view>
3838

39-
<view wx:if="{{show && !fullScreen}}" style="position: relative">
39+
<view wx:if="{{!fullScreen}}" style="position: relative">
4040
<slot name="content"/>
41-
<view class="inner-loading-container" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}"></view>
42-
<view class="l-class loading-icon-container">
41+
<view wx:if="{{show}}" class="inner-loading-container" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}"></view>
42+
<view wx:if="{{show}}" class="l-class loading-icon-container" style="z-index:{{zIndex + 1}}">
4343
<view class="{{type + '-spinner'}} {{type=='change'||custom?'':'spinner-' + type + '-' + size}}">
4444
<block wx:if="{{custom}}">
4545
<slot />

examples/pages/components/view/pages/loading/index.wxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
class="content"
1616
name="指定loading区域"
1717
>
18-
<l-loading show="{{true}}" type="circle" opacity="0.1" bg-color="#ccc" custom l-class="position-top">
19-
<view slot="content" style="height: 300px;"></view>
18+
<l-loading show="{{true}}" type="circle" custom l-class="position-top" z-index="112">
19+
<view slot="content" style="height: 300px;">1111</view>
2020
<image class='custom-img' src='/images/static/loading.gif'></image>
2121
</l-loading>
2222
</content-card>

src/loading/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ Component({
1515
type: String,
1616
value: '1'
1717
},
18-
bgColor: String,
18+
bgColor: {
19+
type: String,
20+
value: '#fff'
21+
},
1922
zIndex:{
20-
type:String,
21-
value: '776'
23+
type: Number,
24+
value: 776
2225
},
2326
// 类型
2427
type: {

src/loading/index.wxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
</view>
3737
</view>
3838

39-
<view wx:if="{{show && !fullScreen}}" style="position: relative">
39+
<view wx:if="{{!fullScreen}}" style="position: relative">
4040
<slot name="content"/>
41-
<view class="inner-loading-container" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}"></view>
42-
<view class="l-class loading-icon-container">
41+
<view wx:if="{{show}}" class="inner-loading-container" style="background:{{bgColor}};opacity:{{opacity}};z-index:{{zIndex}}"></view>
42+
<view wx:if="{{show}}" class="l-class loading-icon-container" style="z-index:{{zIndex + 1}}">
4343
<view class="{{type + '-spinner'}} {{type=='change'||custom?'':'spinner-' + type + '-' + size}}">
4444
<block wx:if="{{custom}}">
4545
<slot />

0 commit comments

Comments
 (0)