♻️ (pagetop): setup() recibe &mut Context
Antes sólo mutaba el propio componente; ahora también puede aplicar ajustes síncronos sobre el Context, visibles para las extensiones que intercepten BeforeRender. La frontera con prepare() pasa a ser de sincronía, no de qué puede mutar cada uno.
This commit is contained in:
parent
f2a7507317
commit
1e2d171805
31 changed files with 71 additions and 59 deletions
|
|
@ -31,7 +31,7 @@ impl Component for Icon {
|
|||
self.props.get_id()
|
||||
}
|
||||
|
||||
fn setup(&mut self, _cx: &Context) {
|
||||
fn setup(&mut self, _cx: &mut Context) {
|
||||
if !matches!(self.icon_kind(), IconKind::None) {
|
||||
self.alter_prop(PropsOp::prepend_classes("icon"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ impl Component for Offcanvas {
|
|||
self.props.get_id()
|
||||
}
|
||||
|
||||
fn setup(&mut self, cx: &Context) {
|
||||
fn setup(&mut self, cx: &mut Context) {
|
||||
// Asegura que el panel tiene un identificador único.
|
||||
self.alter_prop(PropsOp::ensure_id(cx.build_id::<Self>(1)));
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ impl Component for RoleTable {
|
|||
self.props.get_id()
|
||||
}
|
||||
|
||||
fn setup(&mut self, _cx: &Context) {
|
||||
fn setup(&mut self, _cx: &mut Context) {
|
||||
self.alter_prop(PropsOp::set_id("role-table-wrapper"));
|
||||
self.alter_prop(PropsOp::prepend_classes("user-admin-table-wrapper"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ impl Component for UserTable {
|
|||
self.props.get_id()
|
||||
}
|
||||
|
||||
fn setup(&mut self, _cx: &Context) {
|
||||
fn setup(&mut self, _cx: &mut Context) {
|
||||
self.alter_prop(PropsOp::set_id("user-table-wrapper"));
|
||||
self.alter_prop(PropsOp::prepend_classes("user-admin-table-wrapper"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue