Skip to content

Commit

Permalink
fix: 修复DatePicker组件onVisibleChange事件参数未适配微信的问题 (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
IceApriler committed Apr 11, 2024
1 parent 51b349b commit 1ab1ca8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions compiled/alipay/src/DatePicker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '../_util/assert-component2';
import { mountComponent } from '../_util/component';
import { useComponentEvent } from '../_util/hooks/useComponentEvent';
import { useMixState } from '../_util/hooks/useMixState';
import { resolveEventValues } from '../_util/platform';
import { resolveEventValues, resolveEventValue } from '../_util/platform';
import { DatePickerFunctionalProps, IDatePickerProps } from './props';
import {
getDateByValue,
Expand Down Expand Up @@ -119,7 +119,8 @@ const DatePicker = (props: IDatePickerProps) => {
}
}

useEvent('onVisibleChange', (visible) => {
useEvent('onVisibleChange', (event) => {
const visible = resolveEventValue(event)
if (visible) {
const currentValue = getCurrentValueWithCValue(props);
const newColumns = generateData(currentValue, props);
Expand Down
5 changes: 3 additions & 2 deletions compiled/wechat/src/DatePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '../_util/assert-component2';
import { mountComponent } from '../_util/component';
import { useComponentEvent } from '../_util/hooks/useComponentEvent';
import { useMixState } from '../_util/hooks/useMixState';
import { resolveEventValues } from '../_util/platform';
import { resolveEventValues, resolveEventValue } from '../_util/platform';
import { DatePickerFunctionalProps } from './props';
import { getDateByValue, getRangeData, getValidValue, getValueByDate, } from './util';
function getMin(min) {
Expand Down Expand Up @@ -95,7 +95,8 @@ var DatePicker = function (props) {
}
}
}
useEvent('onVisibleChange', function (visible) {
useEvent('onVisibleChange', function (event) {
var visible = resolveEventValue(event);
if (visible) {
var currentValue = getCurrentValueWithCValue(props);
var newColumns = generateData(currentValue, props);
Expand Down
5 changes: 3 additions & 2 deletions src/DatePicker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '../_util/assert-component2';
import { mountComponent } from '../_util/component';
import { useComponentEvent } from '../_util/hooks/useComponentEvent';
import { useMixState } from '../_util/hooks/useMixState';
import { resolveEventValues } from '../_util/platform';
import { resolveEventValues, resolveEventValue } from '../_util/platform';
import { DatePickerFunctionalProps, IDatePickerProps } from './props';
import {
getDateByValue,
Expand Down Expand Up @@ -119,7 +119,8 @@ const DatePicker = (props: IDatePickerProps) => {
}
}

useEvent('onVisibleChange', (visible) => {
useEvent('onVisibleChange', (event) => {
const visible = resolveEventValue(event)
if (visible) {
const currentValue = getCurrentValueWithCValue(props);
const newColumns = generateData(currentValue, props);
Expand Down

0 comments on commit 1ab1ca8

Please sign in to comment.