我使用用 React + Typescript 编写的 Fabric 组件,当使用 Checkbox 组件时,我可以添加自定义属性等data-id
- 这也写在文档中:https ://developer.microsoft.com/en-us/fabric#/components /复选框
有什么问题 ?我不知道如何通过将其传递给inputProps
.
HTMLAttribute
字段的 React 接口data
需要string
值。
从我所见,React 的接口HTMLAttribute
是通用的,Checkbox 组件在那里传递了这个接口:https ://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/global.d.ts - 它们是空的。
有人知道如何在那里实现data-
属性吗?