wechat/component

component module provides miniprogram component bindings details in wechat document

Types

pub type Property {
  IntProperty(name: String, value: Int)
  NumberProperty(name: String, value: Float)
  BooleanProperty(name: String, value: Bool)
  StringProperty(name: String, value: String)
  ObjectProperty(name: String, value: object.JsObject)
  ArrayProperty(name: String, value: object.JsObject)
}

Constructors

  • IntProperty(name: String, value: Int)
  • NumberProperty(name: String, value: Float)
  • BooleanProperty(name: String, value: Bool)
  • StringProperty(name: String, value: String)
  • ObjectProperty(name: String, value: object.JsObject)
  • ArrayProperty(name: String, value: object.JsObject)

SelectorQuery type

pub type SelectorQuery

Values

pub fn run_component(o: object.JsObject) -> Nil

component constructor Component({...})

pub fn select_component(
  component c: object.JsObject,
  selector s: String,
) -> object.JsObject

component.selectComponent() for the specified component

pub fn to_object(p: Property) -> object.JsObject

property to object

pub fn to_properties(ps: List(Property)) -> object.JsObject

properties to object

pub fn trigger_event(
  component c: object.JsObject,
  event e: String,
  detail d: object.JsObject,
  option o: object.JsObject,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
Search Document