Skip to content

UI

提供预制的UI小组件

showFullscreen()

显示全屏按钮。

  • 返回:

    • 显示当前全屏按钮后的返回信息
  • 详情:

显示全屏按钮。

  • 示例:
js
import KAPI from '@ibrucekong/kapi'
const kapi = await KAPI.build('Your Auth Token')
const scene = new kapi.Scene('kapi-container', { server: 'Your Service URL' })
const readyState = await scene.ready()
if (readyState.code !== 200) return

const full = await kapi.ui.showFullscreen()
console.log(full)

hideFullscreen()

隐藏全屏按钮。

  • 返回:

    • 隐藏当前全屏按钮后的返回信息
  • 详情:

隐藏全屏按钮。

  • 示例:
js
import KAPI from '@ibrucekong/kapi'
const kapi = await KAPI.build('Your Auth Token')
const scene = new kapi.Scene('kapi-container', { server: 'Your Service URL' })
const readyState = await scene.ready()
if (readyState.code !== 200) return

const full = await kapi.ui.hideFullscreen()
console.log(full)

showNetStatus()

显示网络面板。

  • 返回:

    • 显示当前网络面板后的返回信息
  • 详情:

显示网络面板。

  • 示例:
js
import KAPI from '@ibrucekong/kapi'
const kapi = await KAPI.build('Your Auth Token')
const scene = new kapi.Scene('kapi-container', { server: 'Your Service URL' })
const readyState = await scene.ready()
if (readyState.code !== 200) return

const net = await kapi.ui.showNetStatus()
console.log(net)

hideNetStatus()

隐藏网络面板。

  • 返回:

    • 隐藏当前网络面板后的返回信息
  • 详情:

隐藏网络面板。

  • 示例:
js
import KAPI from '@ibrucekong/kapi'
const kapi = await KAPI.build('Your Auth Token')
const scene = new kapi.Scene('kapi-container', { server: 'Your Service URL' })
const readyState = await scene.ready()
if (readyState.code !== 200) return

const net = await kapi.ui.hideNetStatus()
console.log(net)
UI has loaded