我正在尝试使输入字段为只读
<input type='text' name='email' readonly />
我得到的错误是
Type '{ type: string; name: string; readonly: true; }' is not assignable to type 'DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>'.
Property 'readonly' does not exist on type 'DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>'.ts(2322)
答案 0 :(得分:2)
ReadOnly是您需要使用的道具。确保O是大写字母。