中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
微信扫码分享
@Entry @Component struct TextInputPage { @State message: string = ''; build() { Column() { TextInput({ text: `${this.message}` }) .height(48) .onChange(str => { this.message = str; //这行必须得加 console.info('...str:' + str); if(str.length > 3){ this.message = str.substring(0, 3) } }) } .width('100%') } }"