我在我的 reactjs 代碼中安裝了星級評分包,以顯示我從虛擬 API 獲得的星級值。
import { Rating } from "react-simple-star-rating";
但是當我試圖讓它只讀我時,它變成只讀但是當我嘗試添加我自己的值時..它沒有顯示任何值..代碼示例:
<Rating
ratingValue={product.rating} //this value doesn't applies to the star.. we get floating value in here..example 2.55 but it still don't work when I try giving actual value like 2,3,etc
readonly={true} //it becomes read only
initialValue="3" //this also doesn't work
/>
uj5u.com熱心網友回復:
嘗試使用大括號而不是引號
initialValue={3}
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/503828.html
標籤:javascript 反应 npm
