Skip to content

Commit f9deacf

Browse files
committed
fix: 🐛 Radio修复在cell里面高度的问题
1 parent c6b2cf8 commit f9deacf

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/pages/form/demo3.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@
103103
<wd-upload :file-list="model.fileList" action="https://ftf.jd.com/api/uploadImg" @change="handleFileChange"></wd-upload>
104104
</wd-cell>
105105
</wd-cell-group>
106+
<wd-cell title="性别" required prop="sex" center>
107+
<wd-radio-group shape="dot" cell inline v-model="model.sex">
108+
<wd-radio :value="1">男</wd-radio>
109+
<wd-radio :value="2">女</wd-radio>
110+
</wd-radio-group>
111+
</wd-cell>
106112
<view class="tip">
107113
<wd-checkbox v-model="model.read" prop="read" custom-label-class="label-class">
108114
已阅读并同意
@@ -144,6 +150,7 @@ const model = reactive<{
144150
phone: string
145151
read: boolean
146152
fileList: UploadFileItem[]
153+
sex: number
147154
}>({
148155
couponName: '',
149156
platform: [],
@@ -159,7 +166,8 @@ const model = reactive<{
159166
cardId: '',
160167
phone: '',
161168
read: false,
162-
fileList: []
169+
fileList: [],
170+
sex: 1
163171
})
164172
165173
const rules: FormRules = {
@@ -415,24 +423,29 @@ function handleIconClick() {
415423
color: $-dark-color3;
416424
}
417425
}
426+
418427
.inline-txt {
419428
display: inline-block;
420429
font-size: 14px;
421430
margin: 0 8px;
422431
color: rgba(0, 0, 0, 0.45);
423432
vertical-align: middle;
424433
}
434+
425435
:deep(.group) {
426436
margin-top: 12px;
427437
}
438+
428439
.tip {
429440
margin: 10px 15px 21px;
430441
color: #999;
431442
font-size: 12px;
432443
}
444+
433445
.footer {
434446
padding: 0 25px 21px;
435447
}
448+
436449
:deep(.label-class) {
437450
color: #999 !important;
438451
font-size: 12px !important;

src/uni_modules/wot-design-uni/components/wd-radio/index.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@
244244

245245
// 以下内容用于解决父子组件样式隔离的问题 —— START
246246
@include when(cell-radio) {
247-
padding: 13px 15px;
247+
padding:0px 15px;
248248
margin: 0;
249+
line-height:inherit;
249250

250251
@include when(large) {
251252
padding: 14px 15px;

0 commit comments

Comments
 (0)