
如何写精华回答,获更多曝光?
发布
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
})
}
}