# @gramlot/gramlot-examples 中文文档

规范地址：https://npmcn.com/package/%40gramlot/gramlot-examples/

版本：0\.3\.46
npm 元数据更新时间：2026-11-10T17:35:06.624Z
中文译文更新时间：2026-11-17T03:52:05.330Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40gramlot/gramlot-examples
原文对照：https://npmcn.com/package/%40gramlot/gramlot-examples/?lang=original
项目主页：https://github.com/gramlot-org/gramlot-examples#readme
源码仓库：https://github.com/gramlot-org/gramlot-examples

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：16.5 MB，868 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=22
- 运行依赖：1 个
- 首次发布：2026-10-03T05:34:43.885Z
- 最新版本发布：2026-11-10T17:35:06.219Z
- 近 30 天下载量：7115（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：52（近 12 个月 52 个）

## 中文简介

格莱克洛特的例子页,画廊页及其目录.

## 安装

```sh
npm install @gramlot/gramlot-examples
```

也可以使用：`pnpm add @gramlot/gramlot-examples`、`yarn add @gramlot/gramlot-examples`、`bun add @gramlot/gramlot-examples`

## README

# 格洛特实例

常见的例子页 [格莱特](https://github.com/gramlot-org/gramlot),则 展出它们及其目录的画廊页。 作为包件发布 仅依赖于 Gramlot 核心 :

```sh
pip install gramlot-examples
npm install @gramlot/gramlot-examples
```

[![PyPI](https://img.shields.io/pypi/v/gramlot-examples)](https://pypi.org/project/gramlot-examples/) [![npm](https://img.shields.io/npm/v/@gramlot/gramlot-examples)](https://www.npmjs.com/package/@gramlot/gramlot-examples)

目前发行量:0.3.46.

## 本地运行画廊

清除实例以保存可编辑的副本 。 安装 Python 3. 11 或更新, Git和Node.js 22 或 npm 更新后运行(macOS/Linux):

```sh
git clone https://github.com/gramlot-org/gramlot-examples.git
cd gramlot-examples
python3 -m venv .venv
source .venv/bin/activate
npm install --package-lock=false
npm run build
python -m pip install -e . "gramlot-py-server[uvicorn]"
gramlot uvicorn gallery --remote-edit
```

在视窗上,使用 `python -m venv .venv` 并激活环境 `.venv\Scripts\activate` 在命令提示中;其余命令相同.

打开命令打印的本地地址 。 举个例子 **代码** 选项卡, 编辑 Python 源并选择 **保存**; 更新本地源文件 和预览重新加载. `--remote-edit` 允许在 IDE 中保存 临时样本工作空间,在画廊停放时重新设置。 使用这个 选项; 公共画廊只读. 没有选项, 例源仍然只读 .

数据库实例可能需要额外的服务和配置.

[文件和学习顺序](https://gramlot-examples.readthedocs.io/en/latest/) 包括每个课,它的Python和JavaScript源,以及画廊指南. 要运行示例,请选择 [Python 服务器](https://gramlot-py-server.readthedocs.io/en/latest/), (中文(简体) ), [节点.js/ Bun 服务器](https://gramlot-js-server.readthedocs.io/en/latest/010-tutorial.html) 或者说 [无服务器导出器](https://gramlot-js-server.readthedocs.io/en/latest/135-serverless-tutorial.html)。 。 。 .

家庭的储存库如下: [格莱克洛特家族](https://github.com/gramlot-org/gramlot/blob/main/docs/public/055-family.md) (GC-055) (中文(简体) ).

## 更新

选择 [已包装或源检查出更新](https://npmcn.com/package/%40gramlot/gramlot-examples/docs/010-gallery.md#ge-010-050). 从源头安装的 Python 画廊也需要重建它的 JavaScript 捆绑;仅更新 Python 文件并不能更新脚印检查器.

## 页 次

[`src/gramlot_examples/pages/`](https://github.com/gramlot-org/gramlot-examples/blob/main/src/gramlot_examples/pages/README.md) 5个 家庭事务 每个例子都是Python页面及其JavaScript等同的,有一个 同名读取 :

-   `html_svg/`: 十三个 HTML 和 SVG 页面, 不绑定 (`e01`– 说吧 –`e13`(三);
    
-   `binding/`: 11页,其DOM遵循数据(`b01`– 说吧 –`b11`(三);
    
-   `controllers/`: 23页带有公式,控制器,命名逻辑,事件 最终的故事, `dataRpc` 呼叫页面的端点, `remote` 碎片和 `dataRemote` 数值(`c01`– 说吧 –`c23`) (中文(简体) ). 以后的课会介绍主题, 作者的参考文献, 本地问, 父/子信件,普通的 HTML 按钮和延迟 Gramlot 点击。 包裹 需要当前的核心发布; 每一个课程都说明它使用的特性.
    
-   `components/`: 三十四课,用于输入,标签框,格式,组复制, 命令按钮和字段验证(`w01`– 说吧 –`w25`),带有紧凑的控制.
    
-   `layout/`:八次集装箱课程(`l01`– 说吧 –`l08`有活分机,抽屉, 嵌入式布局,选择和关闭事件,十四分页演示, 带导游的抽屉 和懒惰的旋转木马 保留了现场预览.
    

每个 `NN_name.js` 出口 `Page`,以及 `Logic` 当页名客户端方法 Python 页面 `NN_name.py` 拿着 `Logic` 从模块旁边.

## 图片库

画廊页面列出各个家庭,并在README和 来源. `build_gallery` (毕通)并 `buildGallery` (JavaScript)返回其路线和 静态资产; 每一种环境(`gramlot-py-server`, (中文(简体) ), `gramlot-js-server`服务于 拥有自己的服务器并可以添加自己的目录. 指南 : [日内瓦](https://github.com/gramlot-org/gramlot-examples/blob/main/docs/010-gallery.md)。 。 。 .

```sh
npm install --no-package-lock
npm run build
npm test
python -m pytest -q tests
```

[仓库地图](https://github.com/gramlot-org/gramlot-examples/blob/main/docs/005-repository-map.md) (GE-005) (英语).

## 常见问题

### @gramlot/gramlot-examples 是什么？

格莱克洛特的例子页,画廊页及其目录\.

### 如何安装 @gramlot/gramlot-examples？

在项目目录运行 npm install @gramlot/gramlot-examples，或使用 pnpm add / yarn add / bun add。

### @gramlot/gramlot-examples 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/gramlot\_\_gramlot-examples 是否存在。

### @gramlot/gramlot-examples 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @gramlot/gramlot-examples 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @gramlot/gramlot-examples 可以商用吗？

@gramlot/gramlot-examples 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @gramlot/gramlot-examples 的下载量有多少？

根据 npm 官方下载统计，@gramlot/gramlot-examples 在 2026/10/17 – 2026/11/15 这 30 天内被下载 7,115 次，日均约 237 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @gramlot/gramlot-examples 还在维护吗？

最新版本 0\.3\.46 发布于 2026/11/11（6 天前）；至今共发布 52 个版本，其中过去 12 个月发布了 52 个；首次发布于 2026/10/03。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

