最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

如何在react js上获取DateRangePicker(同步融合)的值

网站源码admin26浏览0评论
本文介绍了如何在react js上获取DateRangePicker(同步融合)的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个来自 Syncfusion 的日期范围选择器,我安装了该包并将组件导入到我的 React 项目中.我对 DateRangePicker 非常陌生,所以我想知道如何获得 DateRangePicker 的值.

I have a date range picker from Syncfusion, I installed the package and import the component to my react project. I'm pretty much new to DateRangePicker, so I wonder how can I get the value of the DateRangePicker.

这是我的代码

import React from 'react'
import './DateRangePicker.css'
import {DateRangePickerComponent} from '@syncfusion/ej2-react-calendars'

function DateRangePicker(){
    return(
        <>
            <DateRangePickerComponent></DateRangePickerComponent>
        </>
    )
}

export default DateRangePicker

输出如下:

推荐答案

你可以通过一个 prop 来获取 DateRangePickerComponent 的值:更改

You can get the value of DateRangePickerComponent by pass a prop: change

function DateRangePicker(){
    const onChange = (props) => {
        const stateDate = props.startDate;
        const endDate = props.endDate;

    };
    return(
        <>
            <DateRangePickerComponent change={onChange} />
        </>
    )
}

这篇关于如何在react js上获取DateRangePicker(同步融合)的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

发布评论

评论列表(0)

  1. 暂无评论