【HarmonyOS开发小实践】ArkUI 自定义组件与 Modifier:把界面拆成可复用的单元
最基础的封装用@Componentbuild()// 定义一个可复用的"评分条"组件@Component// 评分,0-5build() {Row() {// 小于等于 score 的星是实心的'★' : '☆')// 使用@Entry@Componentbuild() {RatingBar({ score: 4 }) // 4 星RatingBar({ score: 5, maxScore: 1
所有评论(0)