美文网首页
06 - 路由

06 - 路由

作者: _RG | 来源:发表于2024-07-02 16:23 被阅读0次
截屏2024-07-03 14.42.49.png 截屏2024-07-03 14.48.03.png

所有需要路由的页面,或者进行路由操作的当前页面都需要维护到main_pages.json

截屏2024-07-03 16.05.00.png

获取路由参数传递过来的参数 router.getParams()

struct ObservedAndObjectLink {
  params: any = router.getParams()

  build() {
    Column({space: 20}){

      if (this.params) {
        Text(`标题: ${this.params.id}`)
          .fontSize(30)
          .backgroundColor('#aaa')
      }
  }
}
截屏2024-07-03 16.23.07.png

相关文章

网友评论

      本文标题:06 - 路由

      本文链接:https://www.haomeiwen.com/subject/vhivcjtx.html