{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# `ui.space`\n", "\n", "## 空间\n", "\n", "这个元素基于 Quasar 的 [QSpace 组件](https://quasar.dev/vue-components/space)。\n", "\n", "它的目的是简单地填充 flexbox 元素内的所有可用空间。" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from nicegui import ui\n", "\n", "with ui.row().classes('w-full border'):\n", " ui.label('Left')\n", " ui.space()\n", " ui.label('Right')\n", "\n", "# ui.run()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 垂直空间\n", "\n", "这个元素也可以用来填充垂直空间。" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from nicegui import ui\n", "\n", "with ui.column().classes('h-32 border'):\n", " ui.label('Top')\n", " ui.space()\n", " ui.label('Bottom')\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 }