Skip to content

Commit 9799f94

Browse files
committed
feat: 支持优化处理 text-decoration 属性
1 parent b698459 commit 9799f94

File tree

7 files changed

+348
-195
lines changed

7 files changed

+348
-195
lines changed

__test__/fixure/Mod.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.cnt_row,.icon {
44
width:18px;
55
height:18px;
6+
text-decoration: line-through;
67
}
78
.line1 {
89
text-overflow:ellipsis;

__test__/fixure/mod.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ export default class Mod extends React.Component {
3434
<>
3535
<img
3636
className='icon'
37+
style={{
38+
color: 'red'
39+
}}
3740
src='//img20.360buyimg.com/img/jfs/t1/166410/12/38783/3147/64f58062Fd7737e2b/5aaf0205cd1ce175.png'
3841
></img>
3942
<>

__test__/index.spec.mjs.md

Lines changed: 95 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -13,104 +13,112 @@ Generated by [AVA](https://avajs.dev).
1313
import { calcDynamicStyle as calcDynamicStyle } from "@tarojs/runtime";␊
1414
var __inner_style__ = {␊
1515
"cnt_col": {␊
16-
width: "145px",␊
17-
display: "flex",␊
1816
flexDirection: "column",␊
19-
height: "50px",␊
17+
gap: "8px",␊
18+
width: "145px",␊
2019
alignItems: "flex-start",␊
2120
justifyContent: "center",␊
22-
gap: "8px"␊
21+
height: "50px",␊
22+
display: "flex"␊
2323
},␊
2424
"cnt_row": {␊
25-
display: "flex",␊
26-
gap: "4px",␊
27-
borderRadius: "100px",␊
28-
paddingTop: "8px",␊
29-
paddingBottom: "8px",␊
25+
justifyContent: "center",␊
3026
paddingRight: "8px",␊
31-
height: "24px",␊
3227
backgroundColor: "rgba(0, 0, 0, .7)",␊
33-
justifyContent: "center",␊
34-
flexShrink: "0px",␊
28+
height: "24px",␊
3529
alignItems: "center",␊
30+
paddingBottom: "8px",␊
31+
flexShrink: "0px",␊
32+
display: "flex",␊
33+
textDecoration: {␊
34+
type: TextDecoration["LineThrough"],␊
35+
color: "black"␊
36+
},␊
3637
paddingLeft: "4px",␊
37-
width: "176px"␊
38+
width: "176px",␊
39+
gap: "4px",␊
40+
borderRadius: "100px",␊
41+
paddingTop: "8px"␊
3842
},␊
3943
"cnt_row1": {␊
40-
position: "relative",␊
41-
gap: "10px",␊
42-
justifyContent: "flex-start",␊
44+
width: "311px",␊
45+
height: "50px",␊
4346
display: "flex",␊
47+
justifyContent: "flex-start",␊
48+
gap: "10px",␊
4449
alignItems: "center",␊
45-
width: "311px",␊
46-
height: "50px"␊
50+
position: "relative"␊
4751
},␊
4852
"cnt_row2": {␊
53+
borderColor: "#999",␊
54+
paddingLeft: "8px",␊
55+
width: "110px",␊
56+
top: "3px",␊
57+
left: "201px",␊
58+
flexShrink: "0px",␊
59+
gap: "-94px",␊
60+
justifyContent: "space-between",␊
61+
paddingRight: "8px",␊
62+
display: "flex",␊
63+
borderRadius: "12px",␊
4964
alignItems: "flex-start",␊
5065
borderWidth: "1px",␊
51-
paddingRight: "8px",␊
5266
position: "absolute",␊
53-
left: "201px",␊
54-
borderRadius: "12px",␊
55-
gap: "-94px",␊
56-
flexShrink: "0px",␊
57-
paddingLeft: "8px",␊
67+
height: "23px",␊
5868
paddingBottom: "4px",␊
59-
justifyContent: "space-between",␊
60-
paddingTop: "4px",␊
61-
borderColor: "#999",␊
6269
zIndex: "12",␊
63-
top: "3px",␊
64-
display: "flex",␊
65-
borderStyle: "solid",␊
66-
width: "110px",␊
67-
height: "23px"␊
70+
paddingTop: "4px",␊
71+
borderStyle: "solid"␊
6872
},␊
6973
"cnt_row3": {␊
70-
justifyContent: "space-between",␊
71-
gap: "-311px",␊
72-
display: "flex",␊
7374
alignItems: "center",␊
75+
height: "44px",␊
76+
justifyContent: "space-between",␊
7477
width: "311px",␊
75-
height: "44px"␊
78+
gap: "-311px",␊
79+
display: "flex"␊
7680
},␊
7781
"icon": {␊
7882
width: "18px",␊
83+
textDecoration: {␊
84+
type: TextDecoration["LineThrough"],␊
85+
color: "black"␊
86+
},␊
7987
height: "18px"␊
8088
},␊
8189
"icon1": {␊
8290
width: "15px",␊
8391
height: "15px"␊
8492
},␊
8593
"img": {␊
86-
width: "50px",␊
87-
height: "50px"␊
94+
height: "50px",␊
95+
width: "50px"␊
8896
},␊
8997
"img1": {␊
90-
width: "6px",␊
91-
height: "10px"␊
98+
height: "10px",␊
99+
width: "6px"␊
92100
},␊
93101
"instruction": {␊
102+
color: "#fff",␊
94103
fontSize: "12px",␊
95-
lineHeight: "1",␊
104+
flexShrink: "0px",␊
96105
display: "inline-flex",␊
97-
color: "#fff",␊
98-
flexShrink: "0px"␊
106+
lineHeight: "1"␊
99107
},␊
100108
"instruction1": {␊
101-
fontSize: "16px",␊
102-
width: "116px",␊
103-
flexShrink: "0px",␊
104109
display: "inline-flex",␊
105110
lineHeight: "1",␊
106-
color: "#000"␊
111+
width: "116px",␊
112+
fontSize: "16px",␊
113+
color: "#000",␊
114+
flexShrink: "0px"␊
107115
},␊
108116
"instruction2": {␊
109-
textAlign: "center",␊
110117
flexShrink: "0px",␊
111118
color: "#999",␊
112-
lineHeight: "1.36",␊
113119
overflow: "hidden",␊
120+
textAlign: "center",␊
121+
lineHeight: "1.36",␊
114122
fontSize: "11px"␊
115123
},␊
116124
"line1": {␊
@@ -119,48 +127,48 @@ Generated by [AVA](https://avajs.dev).
119127
textOverflow: "ellipsis"␊
120128
},␊
121129
"mod": {␊
122-
gap: "8px",␊
123-
borderRadius: "8px",␊
124-
width: "343px",␊
125-
flexDirection: "column",␊
126130
paddingBottom: "29px",␊
131+
borderRadius: "8px",␊
132+
alignItems: "flex-start",␊
133+
height: "166px",␊
134+
paddingLeft: "16px",␊
127135
backgroundColor: "#fff6f0",␊
128136
flexShrink: "0px",␊
129-
justifyContent: "center",␊
137+
display: "flex",␊
138+
width: "343px",␊
139+
fontFamily: "Source Han Sans CN",␊
130140
paddingTop: "29px",␊
131-
fontWeight: "500",␊
132141
paddingRight: "16px",␊
133-
fontFamily: "Source Han Sans CN",␊
134-
paddingLeft: "16px",␊
135-
height: "166px",␊
136-
display: "flex",␊
137-
alignItems: "flex-start"␊
142+
gap: "8px",␊
143+
flexDirection: "column",␊
144+
fontWeight: "500",␊
145+
justifyContent: "center"␊
138146
},␊
139147
"txt": {␊
140-
display: "inline-flex",␊
141-
color: "#999",␊
142-
flexShrink: "0px",␊
143148
fontSize: "12px",␊
144-
lineHeight: "1"␊
149+
flexShrink: "0px",␊
150+
lineHeight: "1",␊
151+
color: "#999",␊
152+
display: "inline-flex"␊
145153
},␊
146154
"txt1": {␊
147155
color: "#222",␊
148156
lineHeight: "1.36",␊
149157
flexShrink: "0px",␊
150-
fontSize: "11px",␊
151-
textAlign: "center"␊
158+
textAlign: "center",␊
159+
fontSize: "11px"␊
152160
},␊
153161
"txt2": {␊
154-
width: "290px",␊
155-
fontSize: "12px",␊
156162
lineHeight: "1.83",␊
163+
fontSize: "12px",␊
157164
flexShrink: "0px",␊
165+
width: "290px",␊
158166
color: "#999",␊
159167
display: "inline-flex"␊
160168
}␊
161169
};␊
162170
function Cc() {␊
163-
return <div className='cc'>␊
171+
return <div className={boxClass.join(' ')} style={calcDynamicStyle(__inner_style__, boxClass.join(' '), bannerStyle)}>␊
164172
165173
<span className='line1 txt' style={{␊
166174
color: "#999",␊
@@ -214,32 +222,37 @@ Generated by [AVA](https://avajs.dev).
214222
}␊
215223
render() {␊
216224
return <div className='mod' style={{␊
217-
alignItems: "flex-start",␊
218-
display: "flex",␊
219-
paddingLeft: "16px",␊
220-
fontFamily: "Source Han Sans CN",␊
221-
paddingRight: "16px",␊
225+
justifyContent: "center",␊
222226
fontWeight: "500",␊
227+
flexDirection: "column",␊
228+
gap: "8px",␊
229+
paddingRight: "16px",␊
223230
paddingTop: "29px",␊
224-
justifyContent: "center",␊
231+
fontFamily: "Source Han Sans CN",␊
232+
display: "flex",␊
225233
flexShrink: "0px",␊
226234
backgroundColor: "#fff6f0",␊
227-
paddingBottom: "29px",␊
228-
flexDirection: "column",␊
235+
paddingLeft: "16px",␊
236+
alignItems: "flex-start",␊
229237
borderRadius: "8px",␊
230-
gap: "8px",␊
238+
paddingBottom: "29px",␊
231239
width: '500px',␊
232240
height: 800␊
233241
}}>␊
234242
235-
<div className={classnames('cnt_row')} style={calcDynamicStyle(__inner_style__, classnames('cnt_row'), null)}>␊
243+
<div className={classnames('cnt_row')} style style={calcDynamicStyle(__inner_style__, classnames('cnt_row'), null)}>␊
236244
237245
<>␊
238246
239-
<img className='icon' src='//img20.360buyimg.com/img/jfs/t1/166410/12/38783/3147/64f58062Fd7737e2b/5aaf0205cd1ce175.png' style={{␊
247+
<img className='icon' style={{␊
240248
height: "18px",␊
241-
width: "18px"␊
242-
}}></img>␊
249+
textDecoration: {␊
250+
type: TextDecoration["LineThrough"],␊
251+
color: 'red'␊
252+
},␊
253+
width: "18px",␊
254+
color: 'red'␊
255+
}} src='//img20.360buyimg.com/img/jfs/t1/166410/12/38783/3147/64f58062Fd7737e2b/5aaf0205cd1ce175.png'></img>␊
243256
244257
<>␊
245258

__test__/index.spec.mjs.snap

133 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)