如何在自定义组件的构建流程里跟踪组件数据或者状态,如在build里增加日志跟踪状态变量等
如何在自定义组件的构建流程里跟踪组件数据或者状态,如在build里增加日志跟踪状态变量等
HarmonyOS
赞
收藏 0
回答 1
待解决
使用@Watch回调来监测状态变量的变化,如果执行回调函数,说明在下一次vysnc信号发送时,使用该状态变量的UI会刷新绘制。
参考代码如下:
参考链接
watch和自定义组件更新