feat: document translation

This commit is contained in:
chenos 2021-10-31 09:58:25 +08:00
parent 08ef78ae8b
commit 34e8226ddb

View File

@ -4,7 +4,7 @@ order: 3
# Installation and Startup Process # Installation and Startup Process
## 项目安装 ## Installation
```bash ```bash
yarn nocobase init yarn nocobase init
@ -13,61 +13,59 @@ yarn nocobase init
- app.constructor() - app.constructor()
- app.parse() - app.parse()
- yarn nocobase init - yarn nocobase init
初始化安装 Initialize the installation
- app.load() - app.load()
加载配置 Load the configuration
- app.emitAsync('beforeLoad') - app.exitAsync('beforeLoad')
所有配置加载之前的钩子 Hook before all configurations are loaded
- app.pluginManager.load() - app.pluginManager.load()
按顺序载入所有激活的插件的配置 Load the configurations of all active plugins in order
- 加载 plugin-collections 的配置 - Load the configuration of plugin-collections
- 添加 app.on('init') 监听 - Add app.on('init') listener
- db.getModel('collections').load() - db.getModel('collections').load()
把 collections 表的配置都导入 db.table() Import the collections table configuration into db.table()
- app.db.sync({force: false}) - app.db.sync({force: false})
再执行 sync创建 collections 表里配置的数据表 Execute sync again to create the data table configured in the collections table
- app.emitAsync('afterLoad') - app.exitAsync('afterLoad')
所有配置加载之后的钩子 All hooks after the configuration is loaded
- app.db.sync({force: true}) - app.db.sync({force: true})
根据配置生成数据表、字段、索引等 Generate data tables, fields, indexes, etc. according to the configuration
- app.emitAsync('init') - app.emitAsync('init')
执行所有 init listeners一般是初始化的数据操作 Perform all init listeners, generally initialized data operations
- 触发 plugin-collections 的 init 事件,数据表就创建好了 - trigger the init event of plugin-collections and the data table is created
- app.stop() - app.stop()
结束 End
## 项目启动 ## Startup
```bash ```bash
yarn nocobase start --init --sync yarn nocobase start --init --sync
# --init 用于启动时快捷安装 # --init for quick installation at startup
# --sync 开发环境时,当 app.collection() 有更新时快速建表或更新表 # --sync to quickly build or update tables when app.collection() is updated in the development environment
``` ```
- app.constructor() - app.constructor()
- app.parse() - app.parse()
- yarn nocobase start - yarn nocobase start
初始化安装 Initialize the installation
- app.load() - app.load()
加载配置 Load the configuration
- app.emitAsync('beforeLoad') - app.exitAsync('beforeLoad')
所有配置加载之前的钩子 Hook before all configurations are loaded
- app.pluginManager.load() - app.pluginManager.load()
按顺序载入所有激活的插件的配置 Load the configurations of all active plugins in order
- 加载 plugin-collections 的配置 - Load the configuration of plugin-collections
- 添加 app.on('start') 监听 - Add app.on('start') listener
- db.getModel('collections').load() - db.getModel('collections').load()
把 collections 表的配置都导入 db.table(),在 start 流程里不需要再 db.sync Import the collections table configuration into db.table(), no need for db.sync in the start process
- app.emitAsync('afterLoad') - app.exitAsync('afterLoad')
所有配置加载之后的钩子 All hooks after configuration loading
- app.db.sync({force: false}) - app.db.sync({force: false})
yarn nocobase start --sync 有更新时快速建表或更新表 yarn nocobase start --sync to quickly build or update tables when there are updates
yarn nocobase start --init 快捷 init yarn nocobase start --init quick init
- app.emitAsync('init') - app.emitAsync('init')
yarn nocobase start --init 快捷 init yarn nocobase start --init shortcut init
- app.emitAsync('start') - app.exitAsync('start')
执行所有 start listeners一般是从数据表里读取一些必要的数据 Execute all start listeners, usually reading some necessary data from the data table
- app.listen() - app.listen()
启动 http server Start the http server