{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 线性进度条\n", "\n", "线性进度条,包装了Quasar的[QLinearProgress组件](https://quasar.dev/vue-components/linear-progress)。\n", "\n", "- `value`: 字段的初始值(从`0.0`到`1.0`)\n", "- `size`: 进度条的高度(默认:带值标签时为`\"20px\"`,不带时为`\"4px\"`)\n", "- `show_value`: 是否在中心显示值标签(默认:True)\n", "- `color`: 颜色(可以是Quasar、Tailwind或CSS颜色,或者`None`,默认:`\"primary\"`)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from nicegui import ui\n", "\n", "slider = ui.slider(min=0, max=1, step=0.01, value=0.5)\n", "ui.linear_progress().bind_value_from(slider, 'value')\n", "\n", "# ui.run()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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 }