Lia开发者

SDK 参考

Lia 自己风格的弹窗、警报和提示,覆盖在你的应用上。

对话框在你的应用上以Lia打开'自己的样式和语言方向,并在他们时暂停你的应用'是开放的。Lia 中的一个'的屏幕同时显示:当一个打开时,另一个会因 busy.

#Lia.confirm(options)

一个Lia中的是或否问题'自己的表格。

const { confirmed } = await Lia.confirm({
  title: "Start a new round?",
  body: "Your score so far won't count.",
  confirm: "Start over",
  danger: true,
});
选项类型
title字符串需要,最多 60 个字符。
body字符串可选,最多 300 个字符。
confirm字符串可选的“是”按钮标签,最多 24 个字符。Lia'自己被遗漏时的词语。
danger布尔值可选。将“是”按钮显示为破坏性操作。

以 { confirmed }, false 但是表格是通过非确认方式关闭的。错误: bad_title, bad_body, bad_confirm, busy.

#Lia.showPopup(params)

一个最多带有三个按钮的消息。解析为按下的按钮's id,或者 null 如果通过其他方式关闭。

const choice = await Lia.showPopup({
  title: "Save your game?",
  message: "You can come back to it later.",
  buttons: [
    { id: "save", type: "default", text: "Save" },
    { id: "delete", type: "destructive", text: "Delete" },
    { type: "cancel" },
  ],
});
参数类型
title字符串可选,最多 64 个字符。
message字符串需要,最多 256 个字符。
buttons数组1到3个按钮。当未使用时有一个关闭按钮。

每个按钮:

字段类型
id字符串什么 showPopup 解决当它'被按下。最多64个字符; "" 当被遗漏时。
type字符串"default", "ok", "close", "cancel" 或 "destructive".
text字符串需要用于 default 和 destructive,最多64 个字符。其他使用Lia'自己被遗漏时的词语。

错误: bad_message, bad_title, bad_buttons, bad_button_type, bad_text, bad_id, busy.

#Lia.showAlert(message)

一个带有关闭按钮的消息。一旦它'的关闭。

await Lia.showAlert("Your progress is saved.");

#Lia.showConfirm(message)

一个带有OK和取消的消息。解析为 true 当OK被按下时。

if (await Lia.showConfirm("Leave this match?")) leaveMatch();

#Lia.toast(message, options)

一条Lia中的简短消息'自己的样式,自己消失。它不'不要暂停您的应用。

Lia.toast("Saved");
Lia.toast("No connection", { tone: "error", position: "top" });
参数类型
message字符串最多140 个字符。
options.position字符串"bottom" (默认)或 "top".
options.tone字符串"info" (默认)或 "error".

以 null。错误: bad_text, bad_position.

自动翻译。英语是真实来源。 阅读英文

输入以搜索每一页、方法和端点。