diff --git a/packages/vant/src/calendar/CalendarHeader.tsx b/packages/vant/src/calendar/CalendarHeader.tsx index 896b5648b..7cca6aef6 100644 --- a/packages/vant/src/calendar/CalendarHeader.tsx +++ b/packages/vant/src/calendar/CalendarHeader.tsx @@ -26,9 +26,8 @@ export default defineComponent({ } }; - const onClickSubtitle = (event: MouseEvent) => { + const onClickSubtitle = (event: MouseEvent) => emit('click-subtitle', event); - }; const renderSubtitle = () => { if (props.showSubtitle) { diff --git a/packages/vant/src/cascader/Cascader.tsx b/packages/vant/src/cascader/Cascader.tsx index deda430eb..a6578ef69 100644 --- a/packages/vant/src/cascader/Cascader.tsx +++ b/packages/vant/src/cascader/Cascader.tsx @@ -205,8 +205,10 @@ export default defineComponent({ selectedOption: CascaderOption | null, tabIndex: number ) => { - const selected = - selectedOption && option[valueKey] === selectedOption[valueKey]; + const { disabled } = option; + const selected = !!( + selectedOption && option[valueKey] === selectedOption[valueKey] + ); const color = option.color || (selected ? props.activeColor : undefined); const Text = slots.option ? ( @@ -217,14 +219,12 @@ export default defineComponent({ return (
  • onSelect(option, tabIndex)} > {Text} @@ -240,7 +240,7 @@ export default defineComponent({ selectedOption: CascaderOption | null, tabIndex: number ) => ( -