# @bigbinary/neeto-templates-frontend 中文文档

规范地址：https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/

版本：3\.3\.0
npm 元数据更新时间：2026-11-03T19:59:54.546Z
中文译文更新时间：2026-11-08T02:15:52.274Z
软件包许可：UNLICENSED

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

原始 npm 页面：https://www.npmjs.com/package/%40bigbinary/neeto-templates-frontend
原文对照：https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/?lang=original
项目主页：https://github.com/bigbinary/neeto-templates-nano

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

- 包体积（解压后）：577 kB，109 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=22\.13
- 运行依赖：0 个
- peer 依赖：qs 6\.16\.2，url 0\.11\.4，yup 0\.32\.11，antd 5\.22\.1，util ^0\.12\.5，axios 1\.20\.0，ramda 0\.29\.0，react 18\.3\.1，buffer ^6\.0\.3，formik 2\.4\.6，i18next 22\.5\.1，zustand 4\.4\.2，dompurify 3\.4\.17，js-logger 1\.6\.1，react-dom 18\.3\.1，classnames 2\.5\.1，stream-http 3\.2\.0，tailwindcss 3\.4\.14，react-helmet ^6\.1\.0，os-browserify 0\.3\.0，react-i18next 12\.3\.1，vm-browserify 1\.1\.2，@babel/runtime 7\.29\.7，react-toastify 8\.0\.2，tty-browserify 0\.0\.1，path-browserify ^1\.0\.1，https-browserify 1\.0\.0，mixpanel-browser 2\.45\.0，react-router-dom 5\.3\.3，crypto-browserify 3\.12\.1，source-map-loader 4\.0\.1，stream-browserify ^3\.0\.0，@bigbinary/neetoui 8\.8\.3，@honeybadger-io/js 6\.10\.1，@bigbinary/neeto-cist 1\.0\.17，@honeybadger-io/react 6\.1\.25，@tanstack/react-query 5\.59\.20，@bigbinary/neeto-atoms 1\.1\.4，@bigbinary/neeto-icons 1\.20\.89，@bigbinary/neeto-molecules 5\.11\.2，@tailwindcss/container-queries 0\.1\.1，@tanstack/react-query-devtools 5\.59\.20，@bigbinary/neeto-commons-frontend 4\.14\.12，@bigbinary/neeto-filters-frontend 4\.7\.1
- 首次发布：2023-11-01T08:32:22.369Z
- 最新版本发布：2026-11-03T19:59:54.388Z
- 近 30 天下载量：6578（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：89（近 12 个月 27 个）

## 中文简介

一个回波作为新纳米结构,配置,数据等的真理来源.

## 安装

```sh
npm install @bigbinary/neeto-templates-frontend
```

也可以使用：`pnpm add @bigbinary/neeto-templates-frontend`、`yarn add @bigbinary/neeto-templates-frontend`、`bun add @bigbinary/neeto-templates-frontend`

## README

# {\\fn黑体\\fs22\\bord1\\shad0\\3ahbe\\4ah00\\fscx67\\fscy66\\2chffffff\\3ch808080}需要调制版 - 不

这个 `neeto-templates-nano` 便利模板的管理 在 neto 应用程序中设置模板。 纳米出口 `@bigbinary/neeto-templates-frontend` 国家防范机制一揽子计划 `neeto-templates-engine` 铁路发展引擎.

# 目录

1.  [用主机应用程序开发](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-development-with-host-application)
    
    -   [发动机](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-engine)
        -   [安装](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-installation)
        -   [使用量](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-usage)
    -   [前端软件包](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-frontend-package)
        -   [安装](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-installation-1)
        -   [发展指示](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-instructions-for-development)
        -   [构成部分](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-components)
        -   [其他职能](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-other-functions)
2.  [出版指令](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/#readme-instructions-for-publishing)
    

# 用主机应用程序开发

## 发动机

该引擎用于管理整个neto的模板和模板设置 产品.

### 安装

1.  将此行添加到您的应用程序的 Gemfile 中 :
    
    ```ruby
    source "NEETO_GEM_SERVER_URL" do
      # ..existing gems
    
      gem 'neeto-templates-engine'
    end
    ```
    
2.  然后执行:
    
    ```shell
    bundle install
    ```
    
3.  运行命令,将所有的迁移,路线,模型,协会,以及 从引擎到主机应用程序所需的控制器 :
    
    ```shell
    bundle exec rails neeto_templates_engine:install
    ```
    
    这将促使用户输入资源模型名称. 资源 模型名称是将作为模板使用的模型的名称. 对于 例如,如果资源模型名称是 `Form`,这将动态生成 《公约》规定的所有必要的协会、路线和管制人员 `neeto_templates_engine` 与小组委员会合作 `Form` 型号.
    
    > **_说明:_** _你可能需要重新安排 协会的声明 通常插入到文件的大多数行上,以满足铁路 标准._
    
4.  添加迁移到数据库 :
    
    ```shell
    bundle exec rails db:migrate
    ```
    

### 使用量

这个 `neeto_templates_engine` 白名单 `templates` 创建子域 模板。 建立于 `templates` 子域作为模板在其它子域中获取.

您可以在此了解更多设置和用途:

1.  [模型](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/docs/engine/models.md)
2.  [主计长](https://npmcn.com/package/%40bigbinary/neeto-templates-frontend/docs/engine/controllers.md)

## 前端软件包

完美整合 `NeetoTemplatesNano` 在您的主机应用程序,它是 用于将 `templates` 子域名。 依此建立的实体 子域将作为模板在 `CreateTemplateModal` 组件.

### 安装

安装最新的 `NeetoTemplatesNano` 使用下列命令的软件包:

```shell
yarn add @bigbinary/neeto-templates-frontend
```

### 发展指示

检查 [前端软件包开发指南](https://neeto-engineering.neetokb.com/p/a-d34cb4b0) 逐步指示制定

### 构成部分

#### `CreateTemplateModal` (单位:千美元)[源代码](https://github.com/bigbinary/neeto-templates-nano/blob/aec3368475c252284a25820c08ff151c1cdd254c/app/javascript/src/components/CreateTemplateModal/index.jsx)(中文(简体) )

CreateTemplate Modal 组件是一个用于创建和 在网络应用程序中预览模板。 它提供了一个用户界面,用于 用户创建模板并查看其细节.

##### 道具

-   `isOpen`: 显示模式是否打开或关闭的布尔.
-   `onClose`: 关闭模式的函数.
-   `isCreating`: 显示模板是否正在运行的布尔旗 创建.
-   `refetchResource`: 用于重置模板资源的函数.
-   `onCreate`:处理模板创建的函数.
-   `afterCreate`: 模板创建后执行动作的函数.
-   `title`: 一个可选的道具来覆盖默认的窗格标题.
-   `description`: 一个可选的道克来覆盖默认的窗格描述.

##### 使用量

```jsx
import React from "react";

import { CreateTemplateModal } from "@bigbinary/neeto-templates-frontend";

const App = () => {
  return (
    <CreateTemplateModal
      isOpen
      onClose={() => {}}
      isCreating={false}
      refetchResource={() => {}}
      onCreate={() => {}}
      afterCreate={() => {}}
    />
  );
};
```

#### `TemplateSettings` (单位:千美元)[源代码](https://github.com/bigbinary/neeto-templates-nano/blob/aec3368475c252284a25820c08ff151c1cdd254c/app/javascript/src/components/TemplateSettings/index.jsx)(中文(简体) )

TemplateSettings 组件是一个用于配置和 编辑网络应用程序中的模板设置。 它提供了一个用户界面 用户可以自定义模板的各个方面,包括其图像、标记, 并预览.

##### 道具

-   `onCancelTemplatePreview`: 处理取消模板的函数 预览.
-   `breadcrumbs`: 用于导航的面包屑项目.
-   `className`:用于造型的 CSS 类名.
-   `resourceId`: 字符串( 如: 窗体Id, 站点Id), 用于指定路径 实体。 默认是"id".

##### 使用量

```jsx
import React from "react";

import { TemplateSettings } from "@bigbinary/neeto-templates-frontend";

const App = () => {
  const breadcrumbs = [
    {
      link: "/forms",
      text: "Forms",
    },
  ];
  return (
    <TemplateSettings
      onCancelTemplatePreview={() => {}}
      breadcrumbs={breadcrumbs}
    />
  );
};
```

使用 `PrivateRoute` 组件,以条件使该组件仅用于 页:1 `templates` 子域名.

#### `TemplateTags` (单位:千美元)[源代码](https://github.com/bigbinary/neeto-templates-nano/blob/aec3368475c252284a25820c08ff151c1cdd254c/app/javascript/src/components/TemplateTags/index.jsx)(中文(简体) )

TemplateTags 组件是一个用于显示和管理的反应组件 网络应用程序中的标记。 它提供了一个用户界面,供用户添加, 删除、编辑和合并标签.

##### 道具

-   `breadcrumbs`: 用于导航的面包屑项目.
    
-   `tagsPath`: 代表标记前端路径的字符串 页 次.
    
-   `otherProps`: 附加道具将传递给组件.
    
    ##### 使用量
    
    ```jsx
    import React from "react";
    import { TemplateTags } from "@bigbinary/neeto-templates-frontend";
    
    const App = () => {
      const breadcrumbs = [
        {
          link: "/forms",
          text: "Forms",
        },
      ];
      return (
        <TemplateTags
          breadcrumbs={breadcrumbs}
          tagsPath="/settings/templates/tags"
        />
      );
    };
    ```
    
    使用 `PrivateRoute` 组件(不需要精确添加) 使此部分仅用于 `templates` 子域名.
    

# 出版指令

咨询 [构建和释放软件包](https://neeto-engineering.neetokb.com/articles/building-and-releasing-packages) 关于如何出版的详细指南.

## 常见问题

### @bigbinary/neeto-templates-frontend 是什么？

一个回波作为新纳米结构,配置,数据等的真理来源\.

### 如何安装 @bigbinary/neeto-templates-frontend？

在项目目录运行 npm install @bigbinary/neeto-templates-frontend，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：qs（6\.16\.2）、url（0\.11\.4）、yup（0\.32\.11）、antd（5\.22\.1）、util（^0\.12\.5）、axios（1\.20\.0）、ramda（0\.29\.0）、react（18\.3\.1）、buffer（^6\.0\.3）、formik（2\.4\.6）、i18next（22\.5\.1）、zustand（4\.4\.2）、dompurify（3\.4\.17）、js-logger（1\.6\.1）、react-dom（18\.3\.1）、classnames（2\.5\.1）、stream-http（3\.2\.0）、tailwindcss（3\.4\.14）、react-helmet（^6\.1\.0）、os-browserify（0\.3\.0）、react-i18next（12\.3\.1）、vm-browserify（1\.1\.2）、@babel/runtime（7\.29\.7）、react-toastify（8\.0\.2）、tty-browserify（0\.0\.1）、path-browserify（^1\.0\.1）、https-browserify（1\.0\.0）、mixpanel-browser（2\.45\.0）、react-router-dom（5\.3\.3）、crypto-browserify（3\.12\.1）、source-map-loader（4\.0\.1）、stream-browserify（^3\.0\.0）、@bigbinary/neetoui（8\.8\.3）、@honeybadger-io/js（6\.10\.1）、@bigbinary/neeto-cist（1\.0\.17）、@honeybadger-io/react（6\.1\.25）、@tanstack/react-query（5\.59\.20）、@bigbinary/neeto-atoms（1\.1\.4）、@bigbinary/neeto-icons（1\.20\.89）、@bigbinary/neeto-molecules（5\.11\.2）、@tailwindcss/container-queries（0\.1\.1）、@tanstack/react-query-devtools（5\.59\.20）、@bigbinary/neeto-commons-frontend（4\.14\.12）、@bigbinary/neeto-filters-frontend（4\.7\.1）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @bigbinary/neeto-templates-frontend 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @bigbinary/neeto-templates-frontend 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @bigbinary/neeto-templates-frontend 需要什么版本的 Node\.js？

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

### @bigbinary/neeto-templates-frontend 可以商用吗？

@bigbinary/neeto-templates-frontend 使用 UNLICENSED 许可。作者声明为 UNLICENSED，即不授予公开使用许可（与公共领域的 Unlicense 不同）。使用前需获得作者授权。以上为概括，不构成法律意见，请以许可原文为准。

### @bigbinary/neeto-templates-frontend 的下载量有多少？

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

### @bigbinary/neeto-templates-frontend 还在维护吗？

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

