docs: clarify layout example dependency and occurrence contracts

This commit is contained in:
2026-11-12 21:23:58 +08:00
parent 94e0f96e4a
commit 8a6bdc3790
8 changed files with 9 additions and 3 deletions
+1
View File
@@ -40,6 +40,7 @@ class RecolorButton: Button {
// 事件阶段可修改已有业务字段;依赖跟踪检测 tint 变化后重绘两个出现位置。
function onEvent(self: RecolorButton, event: Event): Unit {
// 分发器调用 Button 子类的对象方法,无需另写 button.on;这里可写 target,paint 中只能读它。
// onEvent 本身不限定 click:本覆盖没有检查 event.kind,其他经对象方法递送的事件也会执行改色。
self.target.tint = "#526AC7"
}
}