javascript - 如何为材料选择器实现默认工具栏以进行反应?
问题描述
我正在尝试通过在对话框中添加标题来自定义材质选择器(v3)的工具栏。在这个线程之后,我能够为 KeyboardDatePicker 做到这一点。( https://github.com/mui-org/material-ui-pickers/issues/1180 ) 但我还需要在 KeyboardTimePicker 中实现它。
我试图通过将视图更改为小时和分钟来做到这一点,但它们与 KeyboardTimePicker 中的默认工具栏不同(默认工具栏也可以在顶部编辑时间)
有人可以帮我弄这个吗
解决方案
Solved it by below and added additional component on top of the TimePickerToolbar
import { T as TimePickerToolbar } from '@material-ui/pickers/esm/TimePickerToolbar-81100fab.js';
<KeyboardTimePicker
ToolbarComponent={(props) => <TimePickerToolbar {...props}/>
/>
推荐阅读
- sql - 使用存储过程映射到 Shemas
- python - 使用 API 调用进行抓取的多处理或多线程?
- azure - 使用 Connect-AzAccount 连接到 Azure 时处理连接错误
- sql - 提取具有可变开始和长度的子字符串
- node.js - 转换 NodeJS 字节缓冲区
- docker - Dockerized 烧瓶不能与 dockerized neo4j 一起使用
- linux - 无法在 linux 的 sudo 下运行 .sh 脚本
- android - Android 本机应用程序将主机名解析为与浏览器不同的 IP
- android - 我如何使 fs 工作,我尝试了很多选项,但我无法使其工作
- python - 标准化值,几乎达到最小值