struct
Bind
pub struct Bind {
/* private fields */
}Fluent scope builder for component setup functions.
Methods
val
pub fn val<V: Into<Value>>(self, name: &str, f: impl Fn(&Props) -> V + 'static) -> BindBind a value computed from props (re-evaluated on every render).
text
pub fn text(self, name: &'static str, default: &'static str) -> BindBind a text prop with a default.
num
pub fn num(self, name: &'static str, default: f64) -> BindBind name to the number prop name (a prop's value updates it), or default.
classes
pub fn classes(self, name: &str, own: impl Fn(&Props) -> String + 'static) -> Bindname = own classes merged with the caller's class (theirs win).
flag
pub fn flag(self, name: &'static str, default: bool) -> BindBind name to whether prop name is set and truthy, or default.
signal
pub fn signal<T: Clone + Into<Value> + 'static>(self, name: &str, s: &Signal<T>) -> BindBind name to the signal s.
emit
pub fn emit(self, handler: &str, event: &'static str) -> BindA template handler that re-emits as the component event event.
on
pub fn on(self, name: &str, f: impl Fn(&Props, &Event) + 'static) -> BindBind handler name to f, which gets the component's props and the event.