{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 时间\n", "\n", "`Time Input`元素是基于Quasar的[QTime组件](https://quasar.dev/vue-components/date)。时间是一个字符串,格式由 `mask` 参数定义。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- `value`: 初始时间\n", "- `mask`: 时间字符串的格式(默认:`'HH:mm'`)\n", "- `on_change`: 更改时间时执行的回调函数" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from nicegui import ui\n", "\n", "ui.time(value='12:00', on_change=lambda e: result.set_text(e.value))\n", "result = ui.label()\n", "\n", "# ui.run()" ] } ], "metadata": { "kernelspec": { "display_name": "py311", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.7" } }, "nbformat": 4, "nbformat_minor": 2 }