File tree Expand file tree Collapse file tree 3 files changed +35
-11
lines changed
packages/components/skeleton Expand file tree Collapse file tree 3 files changed +35
-11
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ exports[`skeleton Props :text rowCol 1`] = `
65
65
class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
66
66
style = " "
67
67
/>
68
+ <wx-view
69
+ class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
70
+ style = " "
71
+ />
68
72
</wx-view >
69
73
<wx-view
70
74
class = " t-skeleton__row t-class-row"
@@ -73,6 +77,14 @@ exports[`skeleton Props :text rowCol 1`] = `
73
77
class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
74
78
style = " "
75
79
/>
80
+ <wx-view
81
+ class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
82
+ style = " "
83
+ />
84
+ <wx-view
85
+ class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
86
+ style = " "
87
+ />
76
88
</wx-view >
77
89
<wx-view
78
90
class = " t-skeleton__row t-class-row"
@@ -127,6 +139,10 @@ exports[`skeleton Props :text rowCol2 1`] = `
127
139
class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
128
140
style = " "
129
141
/>
142
+ <wx-view
143
+ class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
144
+ style = " "
145
+ />
130
146
</wx-view >
131
147
<wx-view
132
148
class = " t-skeleton__row t-class-row"
@@ -135,6 +151,14 @@ exports[`skeleton Props :text rowCol2 1`] = `
135
151
class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
136
152
style = " "
137
153
/>
154
+ <wx-view
155
+ class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
156
+ style = " "
157
+ />
158
+ <wx-view
159
+ class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
160
+ style = " "
161
+ />
138
162
</wx-view >
139
163
<wx-view
140
164
class = " t-skeleton__row t-class-row"
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default class Skeleton extends SuperComponent {
33
33
data = {
34
34
prefix,
35
35
classPrefix : name ,
36
- parsedRowcols : [ ] ,
36
+ parsedRowCols : [ ] ,
37
37
} ;
38
38
39
39
observers = {
@@ -60,20 +60,19 @@ export default class Skeleton extends SuperComponent {
60
60
init ( ) {
61
61
const { theme, rowCol } = this . properties ;
62
62
const rowCols = [ ] ;
63
+
63
64
if ( rowCol . length ) {
64
65
rowCols . push ( ...rowCol ) ;
65
66
} else {
66
67
rowCols . push ( ...ThemeMap [ theme || 'text' ] ) ;
67
68
}
68
69
69
- const parsedRowcols = rowCols . map ( ( item ) => {
70
+ const parsedRowCols = rowCols . map ( ( item ) => {
70
71
if ( isNumber ( item ) ) {
71
- return [
72
- {
73
- class : this . getColItemClass ( { type : 'text' } ) ,
74
- style : { } ,
75
- } ,
76
- ] ;
72
+ return new Array ( item ) . fill ( {
73
+ class : this . getColItemClass ( { type : 'text' } ) ,
74
+ style : { } ,
75
+ } ) ;
77
76
}
78
77
if ( Array . isArray ( item ) ) {
79
78
return item . map ( ( col ) => {
@@ -96,9 +95,10 @@ export default class Skeleton extends SuperComponent {
96
95
} ) ;
97
96
98
97
this . setData ( {
99
- parsedRowcols ,
98
+ parsedRowCols ,
100
99
} ) ;
101
100
} ,
101
+
102
102
getColItemClass ( obj : SkeletonRowColObj ) : ClassName {
103
103
return classNames ( [
104
104
`${ name } __col` ,
Original file line number Diff line number Diff line change 1
1
<wxs src="../common/utils.wxs" module="_" />
2
2
3
3
<view wx:if="{{ isShow }}" style="{{_._style([style, customStyle])}}" class="{{classPrefix}} class {{prefix}}-class ">
4
- <view wx:if="{{ parsedRowcols .length }}" class="{{classPrefix}}__content">
4
+ <view wx:if="{{ parsedRowCols .length }}" class="{{classPrefix}}__content">
5
5
<view
6
- wx:for="{{parsedRowcols }}"
6
+ wx:for="{{parsedRowCols }}"
7
7
wx:for-index="index"
8
8
wx:for-item="row"
9
9
wx:key="index"
You can’t perform that action at this time.
0 commit comments