wechat/page

page module provides miniprogram page bindings details in wechat document

Functions

pub fn current_page() -> JsObject

get the current page

pub fn get_current_pages() -> Array(JsObject)

global function getCurrentPages()

pub fn get_data(index: Int) -> Result(JsObject, WechatError)

get data of render layer for the current page

pub fn route(page p: JsObject) -> String

page utility function page.route()

pub fn run_page(o: JsObject) -> Nil

page constructor Page({...})

pub fn select_component(
  page p: JsObject,
  component c: String,
) -> JsObject

page.selectComponent() for the specified page

pub fn set_data(
  page p: JsObject,
  data d: JsObject,
  callback f: fn() -> Nil,
) -> Promise(Result(JsObject, WechatError))

set data of render layer for the specified page aysnc, returns Promise

Search Document