Skip to content

Commit 6ff083a

Browse files
authored
style: 优化级联组件样式 (#950)
1 parent a2cd5e6 commit 6ff083a

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

components/cascader/cascaderNode.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default defineComponent({
8888
disabled.value && 'is-disabled',
8989
isExpanded.value && 'is-expanded',
9090
isSelected.value && 'is-selected',
91-
isChecked.value && 'is-checked',
91+
(isChecked.value || isIndeterminate.value) && 'is-checked',
9292
isActive.value && 'is-active',
9393
].filter(Boolean),
9494
);
@@ -191,7 +191,7 @@ export default defineComponent({
191191
<span class={currentClassList}>
192192
{!checkable.value && isSelected.value
193193
? (
194-
<CheckOutlined />
194+
<CheckOutlined class={'is-checked'} />
195195
)
196196
: null}
197197
</span>
@@ -205,10 +205,10 @@ export default defineComponent({
205205
>
206206
{isInitLoading.value || isLoading.value
207207
? (
208-
<LoadingOutlined />
208+
<LoadingOutlined />
209209
)
210210
: (
211-
<RightOutlined />
211+
<RightOutlined />
212212
)}
213213
</span>
214214
);
@@ -219,24 +219,24 @@ export default defineComponent({
219219
<span class={`${prefixCls}-checkbox`}>
220220
{isCheckLoaded.value
221221
? (
222-
<Checkbox
223-
indeterminate={isIndeterminate.value}
224-
modelValue={isChecked.value}
225-
onChange={handleClickCheckbox}
226-
disabled={props.disabled}
227-
/>
228-
)
229-
: (
230-
<Tooltip
231-
placement="top-start"
232-
content={loadingRequiredMessage.value}
233-
>
234222
<Checkbox
235223
indeterminate={isIndeterminate.value}
236224
modelValue={isChecked.value}
237-
disabled={true}
225+
onChange={handleClickCheckbox}
226+
disabled={props.disabled}
238227
/>
239-
</Tooltip>
228+
)
229+
: (
230+
<Tooltip
231+
placement="top-start"
232+
content={loadingRequiredMessage.value}
233+
>
234+
<Checkbox
235+
indeterminate={isIndeterminate.value}
236+
modelValue={isChecked.value}
237+
disabled={true}
238+
/>
239+
</Tooltip>
240240
)}
241241
</span>
242242
);

components/cascader/style/index.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@
8383
&-node-switcher {
8484
width: @data-input-height-base;
8585
height: @data-input-height-base;
86-
color: var(--f-cascader-node-content-wrapper-color);
87-
font-size: @font-size-head;
86+
color: var(--f-text-color);
87+
font-size: @font-size-caption;
8888
&.is-disabled {
89-
cursor: pointer;
89+
cursor: not-allowed;
9090
}
91-
&:hover {
92-
--f-cascader-node-content-wrapper-color: var(--f-primary-color);
91+
.is-checked {
92+
color: var(--f-primary-color);
9393
}
9494
}
9595
&-node-content {

0 commit comments

Comments
 (0)