♻️ (pagetop): Sustituye Attr<T> por Option<T>
`Attr<T>` no aportaba nada sobre `Option<T>` directo: `Getters` ya trata los campos `Option<T>` como caso especial (`Option<&T>`, o `Option<T>` con `#[getters(copy)]`) y `#[builder_fn]` funciona igual sobre ellos.
This commit is contained in:
parent
213aa18b12
commit
bf4c635e59
21 changed files with 171 additions and 245 deletions
|
|
@ -141,7 +141,7 @@ impl Component for Field {
|
|||
|
||||
async fn prepare(&self, cx: &mut Context) -> Result<Markup, ComponentError> {
|
||||
// En `setup()` se garantiza que `name` e `id` están definidos antes del renderizado.
|
||||
let name = self.name().get().unwrap();
|
||||
let name = self.name().as_deref().unwrap();
|
||||
let container_id = self.id().unwrap();
|
||||
|
||||
Ok(html! {
|
||||
|
|
@ -178,8 +178,8 @@ impl Component for Field {
|
|||
type="radio"
|
||||
id=(&item_id)
|
||||
class="form-check-input"
|
||||
name=(&name)
|
||||
value=[item.value().get()]
|
||||
name=(name)
|
||||
value=[item.value().as_deref()]
|
||||
checked[checked]
|
||||
required[*self.required()]
|
||||
disabled[*item.disabled() || *self.disabled()];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue