如何更改 TextField 中的文本颜色?
How to change text color in TextField?
如何将 TextField
中的 value
中的文本颜色更改为红色?
我试过在网上找到的帮助,但没有用,我想可能是因为我使用的是 Typescript,我是 Typescript 的新手。
- 感谢任何帮助!
import React, { useEffect, useState } from 'react';
import { TextField } from '@material-ui/core';
<TextField label="Date" value={object.date} fullWidth />
您可以在输入组件的样式中设置颜色属性。
<TextField inputProps={{ style: { color: "red" } }} />
如何将 TextField
中的 value
中的文本颜色更改为红色?
我试过在网上找到的帮助,但没有用,我想可能是因为我使用的是 Typescript,我是 Typescript 的新手。
- 感谢任何帮助!
import React, { useEffect, useState } from 'react';
import { TextField } from '@material-ui/core';
<TextField label="Date" value={object.date} fullWidth />
您可以在输入组件的样式中设置颜色属性。
<TextField inputProps={{ style: { color: "red" } }} />