Commit 6f5ee7ad authored by 陈龙's avatar 陈龙

feat: 时间选择器增加默认visible属性

parent 764f475e
...@@ -16,8 +16,9 @@ const TimeRangePicker = ({ ...@@ -16,8 +16,9 @@ const TimeRangePicker = ({
dataSource, dataSource,
timeProps, timeProps,
onChange, onChange,
defaultVisible
}) => { }) => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(defaultVisible);
const [visibleKey, setVisibleKey] = useState(null); const [visibleKey, setVisibleKey] = useState(null);
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
...@@ -104,6 +105,7 @@ TimeRangePicker.defaultProps = { ...@@ -104,6 +105,7 @@ TimeRangePicker.defaultProps = {
dataSource: [], dataSource: [],
timeProps: {}, timeProps: {},
onChange: function (v) {}, onChange: function (v) {},
defaultVisible:false
}; };
TimeRangePicker.propTypes = { TimeRangePicker.propTypes = {
...@@ -114,6 +116,7 @@ TimeRangePicker.propTypes = { ...@@ -114,6 +116,7 @@ TimeRangePicker.propTypes = {
dataSource: PropTypes.array, dataSource: PropTypes.array,
timeProps: PropTypes.object, timeProps: PropTypes.object,
onChange: PropTypes.func, onChange: PropTypes.func,
defaultVisible: PropTypes.bool
}; };
export default TimeRangePicker; export default TimeRangePicker;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment