♻️ (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
|
|
@ -203,11 +203,11 @@ impl Component for Pager {
|
|||
return Ok(html! {});
|
||||
}
|
||||
let page = self.current_page().clamp(1, total_pages);
|
||||
let base_path = self.base_path().as_str().unwrap_or_default();
|
||||
let base_path = self.base_path().as_deref().unwrap_or("");
|
||||
|
||||
// Ruta común a los enlaces del paginador, con los parámetros de `extra_query` añadidos a
|
||||
// `base_path`. Pasa por `cx.route()` para preservar el parámetro `lang` si corresponde.
|
||||
let mut route = cx.route(base_path.to_owned());
|
||||
let mut route = cx.route(base_path);
|
||||
for (key, value) in self.extra_query() {
|
||||
route.alter_param(key, value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue