Open vpzomtrrfrt opened 4 years ago
We can have an enum type for HTML attributes (playground link), so:
enum HtmlAttribute {
StringValue(String, String),
BooleanValue(String, bool)
}
and use From<(String, String)>
and From<(String, bool)>
to generate HtmlAttribute
— so the following syntax will be supported:
html! {
<button disabled={true} type="button" />
}
# will be almost like
::render::SimpleElement {
tag_name: "button",
attributes: [HtmlAttribute::from(("disabled", true), HtmlAttribute::from(("type", "button"))],
children: None
}
What do you think?
That seems reasonable
Certain HTML attributes, such as