Skip to content

Commit 25bd514

Browse files
authored
feat: customWrapper 支持 class 和 style 属性 (#19432)
* feat: customWrapper 支持 class 和 style 属性 * feat: 更新快照
1 parent 45f60d1 commit 25bd514

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

packages/shared/src/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ export class BaseTemplate {
477477
if (compName === 'custom-wrapper') {
478478
template += `
479479
<template name="tmpl_${level}_${compName}">
480-
<${compName} i="{{i}}" ${!isSupportRecursive && isUseXS ? 'l="{{l}}"' : ''} id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
480+
<${compName} i="{{i}}" ${!isSupportRecursive && isUseXS ? 'l="{{l}}"' : ''} id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
481481
</${compName}>
482482
</template>
483483
`

tests/__tests__/__snapshots__/skyline.spec.ts.snap

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ require("./runtime");
843843
</template>
844844
845845
<template name="tmpl_0_custom-wrapper">
846-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
846+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
847847
</custom-wrapper>
848848
</template>
849849
@@ -914,7 +914,7 @@ require("./runtime");
914914
</template>
915915
916916
<template name="tmpl_1_custom-wrapper">
917-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
917+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
918918
</custom-wrapper>
919919
</template>
920920
@@ -985,7 +985,7 @@ require("./runtime");
985985
</template>
986986
987987
<template name="tmpl_2_custom-wrapper">
988-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
988+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
989989
</custom-wrapper>
990990
</template>
991991
@@ -1056,7 +1056,7 @@ require("./runtime");
10561056
</template>
10571057
10581058
<template name="tmpl_3_custom-wrapper">
1059-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1059+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
10601060
</custom-wrapper>
10611061
</template>
10621062
@@ -1109,7 +1109,7 @@ require("./runtime");
11091109
</template>
11101110
11111111
<template name="tmpl_4_custom-wrapper">
1112-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1112+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
11131113
</custom-wrapper>
11141114
</template>
11151115
@@ -1162,7 +1162,7 @@ require("./runtime");
11621162
</template>
11631163
11641164
<template name="tmpl_5_custom-wrapper">
1165-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1165+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
11661166
</custom-wrapper>
11671167
</template>
11681168
@@ -1209,7 +1209,7 @@ require("./runtime");
12091209
</template>
12101210
12111211
<template name="tmpl_6_custom-wrapper">
1212-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1212+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
12131213
</custom-wrapper>
12141214
</template>
12151215
@@ -1256,7 +1256,7 @@ require("./runtime");
12561256
</template>
12571257
12581258
<template name="tmpl_7_custom-wrapper">
1259-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1259+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
12601260
</custom-wrapper>
12611261
</template>
12621262
@@ -1303,7 +1303,7 @@ require("./runtime");
13031303
</template>
13041304
13051305
<template name="tmpl_8_custom-wrapper">
1306-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1306+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
13071307
</custom-wrapper>
13081308
</template>
13091309
@@ -1350,7 +1350,7 @@ require("./runtime");
13501350
</template>
13511351
13521352
<template name="tmpl_9_custom-wrapper">
1353-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1353+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
13541354
</custom-wrapper>
13551355
</template>
13561356
@@ -1397,7 +1397,7 @@ require("./runtime");
13971397
</template>
13981398
13991399
<template name="tmpl_10_custom-wrapper">
1400-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1400+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
14011401
</custom-wrapper>
14021402
</template>
14031403
@@ -1444,7 +1444,7 @@ require("./runtime");
14441444
</template>
14451445
14461446
<template name="tmpl_11_custom-wrapper">
1447-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1447+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
14481448
</custom-wrapper>
14491449
</template>
14501450
@@ -1491,7 +1491,7 @@ require("./runtime");
14911491
</template>
14921492
14931493
<template name="tmpl_12_custom-wrapper">
1494-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1494+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
14951495
</custom-wrapper>
14961496
</template>
14971497
@@ -1538,7 +1538,7 @@ require("./runtime");
15381538
</template>
15391539
15401540
<template name="tmpl_13_custom-wrapper">
1541-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1541+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
15421542
</custom-wrapper>
15431543
</template>
15441544
@@ -1585,7 +1585,7 @@ require("./runtime");
15851585
</template>
15861586
15871587
<template name="tmpl_14_custom-wrapper">
1588-
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
1588+
<custom-wrapper i="{{i}}" l="{{l}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}" class="{{i.cl}}" style="{{i.st}}">
15891589
</custom-wrapper>
15901590
</template>
15911591

0 commit comments

Comments
 (0)