为什么用$$已经实现双向绑定效果还是报Cannot find name '$$this'. <ArkTSCheck>


    export class user{
  phone:string
  code:string
  constructor(phone: string, code: string) {
    this.phone = phone
    this.code = code
  }
}

import { user } from '../model/loginModel'
@Entry
@Component
struct login {
  @State formData:user=new user('123','456')
  build() {
    Column({
      space:25
    }){
      Row(){
        TextInput({placeholder:"请输入验证码",text:$$this.formData.code})
          .height(50)
          .backgroundColor(Color.Transparent)
          .borderRadius(0)
          .layoutWeight(1)//使用主轴方向的剩余空间
        Text('获取验证码')
      } .border({
        //width:1
        width:{bottom:1},
        color:"#ccc"
      })
    }
    .padding({
      left:10,
      right:10
    })
  }
}


$$
双向绑定
2025-05-23 11:21:13
浏览
收藏 0
回答 0
待解决
相关问题
HarmonyOS Cannot find name 'ESObject'
1388浏览 • 1回复 待解决
为什么用MOngoDB有知道的吗?
5128浏览 • 1回复 待解决
HarmonyOS如何实现双向数据绑定
1771浏览 • 1回复 待解决
PolarDB的DMS有什么用吗?
4043浏览 • 1回复 待解决
sqlite 的字段长度有什么用
3360浏览 • 1回复 待解决
harmonyos的MDNS有什么用,如何使用
444浏览 • 0回复 待解决
HarmonyOS $$双向绑定问题
1276浏览 • 1回复 待解决
HarmonyOS TextInput双向绑定无效
1112浏览 • 1回复 待解决
HarmonyOS 无法使用$$双向绑定
2302浏览 • 1回复 待解决