@Builder 函数无法被刷新 UI?????

@Builder
shopItem(title: string, subTitle: string) {
  Row() {
    Text(title)
      .fontColor("#FF999999")
      .fontSize(12).margin({ right: 3.5 })
    Text(subTitle + "666")
      .fontColor("#FF444444")
      .fontWeight(FontWeight.Regular)
      .fontSize(12)
  }.margin({ bottom: 11.5 }).width('100%')
}

例如 非list使用  但是需要多次调用  无法刷新

改成下面的  多次使用

@Component
export struct shopItem {
  @Prop title: string = "";
  @Prop subTitle: string = "";

  build() {
    Row() {
      Text(this.title)
        .fontColor("#FF999999")
        .fontSize(12).margin({ right: 3.5 })
      Text(this.subTitle)
        .fontColor("#FF444444")
        .fontWeight(FontWeight.Regular)
        .fontSize(12)
    }.margin({ bottom: 11.5 }).width('100%')

  }
}
shopItem({ title: "主要产品:", subTitle: this.brandDetailBean.products })
shopItem({ title: "公司名称:", subTitle: this.brandDetailBean.chName })
shopItem({ title: "成立时间:", subTitle: this.brandDetailBean.establishTime })

相关推荐

  1. @Builder 函数无法刷新 UI?????

    2024-04-04 09:16:04       31 阅读
  2. 构建ArkTS之@Builder装饰器:自定义构建函数

    2024-04-04 09:16:04       33 阅读
  3. python文件无法作为模块导入

    2024-04-04 09:16:04       30 阅读
  4. 文件、文件夹占用无法删除

    2024-04-04 09:16:04       35 阅读
  5. uniapp scroll-view下拉刷新无法复位

    2024-04-04 09:16:04       31 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-04 09:16:04       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-04 09:16:04       101 阅读
  3. 在Django里面运行非项目文件

    2024-04-04 09:16:04       82 阅读
  4. Python语言-面向对象

    2024-04-04 09:16:04       91 阅读

热门阅读

  1. Opencv人机交互界面设置

    2024-04-04 09:16:04       34 阅读
  2. Unity进阶之路(1)回顾与思考

    2024-04-04 09:16:04       32 阅读
  3. Unity进阶之路(2)UI Toolkit

    2024-04-04 09:16:04       32 阅读
  4. python继承和多态

    2024-04-04 09:16:04       31 阅读
  5. 管理相关方参与的工具与技术

    2024-04-04 09:16:04       39 阅读
  6. rabbitmq消息处理模式

    2024-04-04 09:16:04       31 阅读
  7. git branch 是干什么的

    2024-04-04 09:16:04       37 阅读
  8. django-hexo-admin(一个基于django的hexo博客平台)

    2024-04-04 09:16:04       41 阅读
  9. C#面:.NET 中读写 XML 的类归属于哪些命名空间

    2024-04-04 09:16:04       39 阅读
  10. MongoDB数据更新大之大与小中小

    2024-04-04 09:16:04       36 阅读