我在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
        />发布于 2022-08-31 10:02:51
尝试使用卷边括号而不是引号。
initialValue={3}https://stackoverflow.com/questions/73554070
复制相似问题