{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 分页\n", "\n", "分页元素封装了 Quasar 的 [QPagination 组件](https://quasar.dev/vue-components/pagination)。\n", "\n", "- `min`:最小页码\n", "- `max`:最大页码\n", "- `direction_links`:是否显示首页/末页链接\n", "- `value`:初始页面(如果没有提供值,则默认为 min)\n", "- `on_change`:值改变时要调用的回调函数" ] }, { "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", "p = ui.pagination(1, 5, direction_links=True)\n", "ui.label().bind_text_from(p, 'value', lambda v: f'Page {v}')\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 }