docs: clarify layout example dependency and occurrence contracts
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user