From 7f5f1c2b568f9b5f26fc0b1b122c45be5843fd2b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 23 Jan 2026 17:22:15 +0800 Subject: [PATCH] bugfix --- bricks/countdown.js | 4 ++-- docs/zh/cols.md | 58 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/bricks/countdown.js b/bricks/countdown.js index 6d48ea8..35c9ff9 100644 --- a/bricks/countdown.js +++ b/bricks/countdown.js @@ -23,14 +23,14 @@ bricks.TimePassed = class extends bricks.VBox { this.add_widget(this.text_w); } start(){ - this.task = schedule_once(this.add_one_second.bind(this)); + this.task = schedule_once(this.add_one_second.bind(this), 1); } add_one_second(){ this.seconds += 1; var t = bricks.formatTime(this.seconds); this.text_w.set_text(t); - this.task = schedule_once(this.add_one_second.bind(this)); + this.task = schedule_once(this.add_one_second.bind(this), 1); } stop(){ this.task.cancel(); diff --git a/docs/zh/cols.md b/docs/zh/cols.md index ad71839..50f82e7 100644 --- a/docs/zh/cols.md +++ b/docs/zh/cols.md @@ -30,3 +30,61 @@ | `command` | 当工具栏按钮被点击时,通过 `toolbar_w` 传递上来的命令事件,由 `command_handle` 转发为 `dispatch(name)` | 命令名称(来自 toolbar 的 `params.name`) | > 说明:`dispatch('record_click', data)` 会向外广播该事件,供外部监听处理。 + +## 例子 +``` +{ + "widgettype":"Cols", + "options":{ + "data_url": "{{entire_url('accdetail.dspy')}}", + "data_params":{ + "accountid":"{{params_kw.accountid}}" + }, + "data_method": "GET" + {% if params_kw._is_mobile %} + "col_width": "{{params_kw.width / 2 - 5}}px", + {% else %} + "col_cwidth": 22, + {% endif %} + "record_view":{ + "widgettype":"VBox", + "options":{ + "width":"100%" + }, + "subwidgets":[ + { + "widgettype":"Text", + "options":{ + "text":"${acc_date}" + } + }, + { + "widgettype":"Text", + "options":{ + "text":"${acc_dir}" + } + }, + { + "widgettype":"Text", + "options":{ + "text":"${summary}" + } + }, + { + "widgettype":"Text", + "options":{ + "text":"${amount}" + } + }, + { + "widgettype":"Text", + "options":{ + "text":"${balance}" + } + } + ] + } + } +} +``` +