File tree Expand file tree Collapse file tree 4 files changed +36
-11
lines changed
packages/components/skeleton Expand file tree Collapse file tree 4 files changed +36
-11
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ exports[`skeleton Props :text rowCol 1`] = `
6565 class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
6666 style = " "
6767 />
68+ <wx-view
69+ class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
70+ style = " "
71+ />
6872 </wx-view >
6973 <wx-view
7074 class = " t-skeleton__row t-class-row"
@@ -73,6 +77,14 @@ exports[`skeleton Props :text rowCol 1`] = `
7377 class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
7478 style = " "
7579 />
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+ />
7688 </wx-view >
7789 <wx-view
7890 class = " t-skeleton__row t-class-row"
@@ -127,6 +139,10 @@ exports[`skeleton Props :text rowCol2 1`] = `
127139 class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
128140 style = " "
129141 />
142+ <wx-view
143+ class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
144+ style = " "
145+ />
130146 </wx-view >
131147 <wx-view
132148 class = " t-skeleton__row t-class-row"
@@ -135,6 +151,14 @@ exports[`skeleton Props :text rowCol2 1`] = `
135151 class = " t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col"
136152 style = " "
137153 />
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+ />
138162 </wx-view >
139163 <wx-view
140164 class = " t-skeleton__row t-class-row"
Original file line number Diff line number Diff line change 3131 display : flex ;
3232 align-items : center ;
3333 justify-content : center ;
34+ margin-right : @spacer-2 ;
3435
3536 & :first-child:last-child ,
3637 & :last-child {
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default class Skeleton extends SuperComponent {
3333 data = {
3434 prefix,
3535 classPrefix : name ,
36- parsedRowcols : [ ] ,
36+ parsedRowCols : [ ] ,
3737 } ;
3838
3939 observers = {
@@ -60,20 +60,19 @@ export default class Skeleton extends SuperComponent {
6060 init ( ) {
6161 const { theme, rowCol } = this . properties ;
6262 const rowCols = [ ] ;
63+
6364 if ( rowCol . length ) {
6465 rowCols . push ( ...rowCol ) ;
6566 } else {
6667 rowCols . push ( ...ThemeMap [ theme || 'text' ] ) ;
6768 }
6869
69- const parsedRowcols = rowCols . map ( ( item ) => {
70+ const parsedRowCols = rowCols . map ( ( item ) => {
7071 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+ } ) ;
7776 }
7877 if ( Array . isArray ( item ) ) {
7978 return item . map ( ( col ) => {
@@ -96,9 +95,10 @@ export default class Skeleton extends SuperComponent {
9695 } ) ;
9796
9897 this . setData ( {
99- parsedRowcols ,
98+ parsedRowCols ,
10099 } ) ;
101100 } ,
101+
102102 getColItemClass ( obj : SkeletonRowColObj ) : ClassName {
103103 return classNames ( [
104104 `${ name } __col` ,
Original file line number Diff line number Diff line change 11<wxs src="../common/utils.wxs" module="_" />
22
33<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">
55 <view
6- wx:for="{{parsedRowcols }}"
6+ wx:for="{{parsedRowCols }}"
77 wx:for-index="index"
88 wx:for-item="row"
99 wx:key="index"
You can’t perform that action at this time.
0 commit comments