我怎樣才能將raiting減少到每個瀏覽器只能評價一次?
我需要在React中對raiting組件進行驗證,使客戶在每個瀏覽器中只能評價一次。
以下是評級組件的例子:
export default function App() {
const [value, setValue] = React.useState(0)。
return (
<div>
< Box component="fieldet" mb={3} borderColor="transparent"/span>>
<Typography component="legend"/span>> Rate</Typography>。
<Rating
name="pristine"
value={value}
onClick={(e) => setValue(e.target.value)}。
/>
</Box>
</div>
);
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/306992.html
標籤:
上一篇:如何在三列的基礎上使用Linq獲得不同的值?[重復的]
下一篇:TypeScriptReact:當用JSX.Element型別的靜態屬性擴展React.FC時,擺脫TS(2339)的困擾(未初始化的組件)。
