Lines Matching refs:realState
104 realState: Color = Color.Yellow;
130 // 改变realState不会触发UI视图更新
131 this.realState = this.realState == Color.Yellow ? Color.Red : Color.Yellow;
136 }.backgroundColor(this.updateUI(this.realState))
146 - this.needsUpdate是一个自定义的UI状态变量,应该仅应用于其绑定的UI组件。变量this.realStateArr、this.realState没有被装饰,他们的变化将不会触发UI…
148 - 但是在该应用中,用户试图通过this.needsUpdate的更新来带动常规变量this.realStateArr、this.realState的更新,此方法不合理且更新性能较差。
152 要解决此问题,应将realStateArr和realState成员变量用\@State装饰。一旦完成此操作,就不再需要变量needsUpdate。
160 @State realState: Color = Color.Yellow;
174 // 改变realState触发UI视图更新
175 this.realState = this.realState == Color.Yellow ? Color.Red : Color.Yellow;
177 }.backgroundColor(this.realState)