输入/搜索内容
内置函数
结构体
Ticker
Depth
OrderBook
Trade
Record
Market
Order
Condition
Account
Asset
Position
Funding
其它结构
HttpQuery-options
HttpQuery-return
LogStatus-table
LogStatus-btnTypeOne
LogStatus-btnTypeTwo
状态栏组件
grid
tabs
kpi
stat
progress
gauge
sparkline
chart
heatmap
calendar
histogram
pie
timeline
markdown
alert
badge
Chart-options
Chart-return
KLineChart-options
KLineChart-return
SetData-data
EventLoop-return
exchange.Go-return
DBExec-return
Dial-return
Thread.join-return
内置变量与常量
通用约定
交易所

标签页:每页放一组组件,点击切换;状态栏刷新时保持当前选中的页。

示例

两个标签页分别显示行情和账户。

javascript
function main() { var ticker = exchange.GetTicker() var account = exchange.GetAccount() if (!ticker || !account) return LogStatus({type: "tabs", items: [ {title: "行情", cols: 2, items: [ {type: "kpi", title: "最新价", value: ticker.Last}, {type: "kpi", title: "24小时成交量", value: ticker.Volume, format: {compact: true}} ]}, {title: "账户", items: [{type: "stat", items: [ {label: "可用", value: account.Balance}, {label: "冻结", value: account.FrozenBalance} ]}]} ]}) }
python
def main(): ticker = exchange.GetTicker() account = exchange.GetAccount() if not ticker or not account: return LogStatus({"type": "tabs", "items": [ {"title": "行情", "cols": 2, "items": [ {"type": "kpi", "title": "最新价", "value": ticker["Last"]}, {"type": "kpi", "title": "24小时成交量", "value": ticker["Volume"], "format": {"compact": True}} ]}, {"title": "账户", "items": [{"type": "stat", "items": [ {"label": "可用", "value": account["Balance"]}, {"label": "冻结", "value": account["FrozenBalance"]} ]}]} ]})
rust
fn main() { let Ok(t) = exchange.GetTicker(None) else { return }; let Ok(a) = exchange.GetAccount() else { return }; let market = format!( r#"{{"title": "行情", "cols": 2, "items": [ {{"type": "kpi", "title": "最新价", "value": {}}}, {{"type": "kpi", "title": "24小时成交量", "value": {}, "format": {{"compact": true}}}}]}}"#, t.Last, t.Volume ); let account = format!( r#"{{"title": "账户", "items": [{{"type": "stat", "items": [ {{"label": "可用", "value": {}}}, {{"label": "冻结", "value": {}}}]}}]}}"#, a.Balance, a.FrozenBalance ); // 整个状态栏只有这一段组件 JSON 时,JSON 可以写成多行 LogStatus!(format!(r#"{{"type": "tabs", "items": [{}, {}]}}"#, market, account)); }

属性

名称类型描述

type

string

必填,固定为 tabs。

items

object数组

必填。每项是一页。

items[].title

string

标签文字。

items[].items

array

该页的组件,按grid排列。

items[].cols

number

该页的列数。默认 1。

id

string

稳定标识。组件的个数或顺序会变化时设置,状态栏刷新时组件不重建。

span

number

在所在grid中占几列。默认 1。

参考

备注

tabs 没有自己的标题。各页内容与 grid 一样按容器宽度自动减列,嵌套最多 6 层。

只含表格的数组用反引号包裹输出时(旧写法)也显示为标签页,见LogStatus-table。