Replace deprecated methods
This commit is contained in:
parent
103691a000
commit
c0220d3551
34
src/dom.rs
34
src/dom.rs
|
@ -1396,31 +1396,31 @@ mod tests {
|
|||
#[test]
|
||||
fn property_signal_types() {
|
||||
let _a: DomBuilder<HtmlElement> = DomBuilder::new_html("div")
|
||||
.property("foo", "hi")
|
||||
.property("foo", 5)
|
||||
.property(["foo", "-webkit-foo", "-ms-foo"], "hi")
|
||||
.prop("foo", "hi")
|
||||
.prop("foo", 5)
|
||||
.prop(["foo", "-webkit-foo", "-ms-foo"], "hi")
|
||||
|
||||
.property_signal("foo", always("hi"))
|
||||
.property_signal("foo", always(5))
|
||||
.property_signal("foo", always(Some("hi")))
|
||||
.prop_signal("foo", always("hi"))
|
||||
.prop_signal("foo", always(5))
|
||||
.prop_signal("foo", always(Some("hi")))
|
||||
|
||||
.property_signal(["foo", "-webkit-foo", "-ms-foo"], always("hi"))
|
||||
.property_signal(["foo", "-webkit-foo", "-ms-foo"], always(5))
|
||||
.property_signal(["foo", "-webkit-foo", "-ms-foo"], always(Some("hi")))
|
||||
.prop_signal(["foo", "-webkit-foo", "-ms-foo"], always("hi"))
|
||||
.prop_signal(["foo", "-webkit-foo", "-ms-foo"], always(5))
|
||||
.prop_signal(["foo", "-webkit-foo", "-ms-foo"], always(Some("hi")))
|
||||
;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn attribute_signal_types() {
|
||||
let _a: DomBuilder<HtmlElement> = DomBuilder::new_html("div")
|
||||
.attribute("foo", "hi")
|
||||
.attribute(["foo", "-webkit-foo", "-ms-foo"], "hi")
|
||||
.attr("foo", "hi")
|
||||
.attr(["foo", "-webkit-foo", "-ms-foo"], "hi")
|
||||
|
||||
.attribute_signal("foo", always("hi"))
|
||||
.attribute_signal("foo", always(Some("hi")))
|
||||
.attr_signal("foo", always("hi"))
|
||||
.attr_signal("foo", always(Some("hi")))
|
||||
|
||||
.attribute_signal(["foo", "-webkit-foo", "-ms-foo"], always("hi"))
|
||||
.attribute_signal(["foo", "-webkit-foo", "-ms-foo"], always(Some("hi")))
|
||||
.attr_signal(["foo", "-webkit-foo", "-ms-foo"], always("hi"))
|
||||
.attr_signal(["foo", "-webkit-foo", "-ms-foo"], always(Some("hi")))
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -1491,11 +1491,11 @@ mod tests {
|
|||
fn with_cfg() {
|
||||
let _a = html!("div", {
|
||||
.with_cfg!(target_arch = "wasm32", {
|
||||
.attribute("foo", "bar")
|
||||
.attr("foo", "bar")
|
||||
})
|
||||
|
||||
.with_cfg!(all(not(foo), bar = "test", feature = "hi"), {
|
||||
.attribute("foo", "bar")
|
||||
.attr("foo", "bar")
|
||||
})
|
||||
});
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ pub fn link<A, F>(url: A, f: F) -> Dom
|
|||
let url = url.into();
|
||||
|
||||
html!("a", {
|
||||
.attribute("href", &url)
|
||||
.attr("href", &url)
|
||||
.apply(on_click_go_to_url(url))
|
||||
.apply(f)
|
||||
})
|
||||
|
@ -122,7 +122,7 @@ macro_rules! link {
|
|||
let url = $url;
|
||||
|
||||
$crate::html!("a", {
|
||||
.attribute("href", &url)
|
||||
.attr("href", &url)
|
||||
.apply(move |dom| $crate::on_click_go_to_url!(dom, url))
|
||||
$($methods)*
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue