参考demo:@Entry @Component struct Index { @State message: string = 'Hello World'; build() { Column() { TextInput({ text: this.message }).focusOnTouch(false).fontColor(Color.Red) TextInput({ text: this.message }).focusOnTouch(true).fontColor(Color.Red) } } }
参考demo: