Skip to content

Commit

Permalink
docs(projects): update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Jan 18, 2024
1 parent 2d7882c commit ea2a1f9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,23 @@ English | [中文](./README.zh_CN.md)

## Introduction

ElegantRouter is a tool for creating routes based on the file system. It can directly and automatically generate route definitions, route file imports, and route-related type definitions. You only need to create route files according to the agreed rules, and you don't need to write any additional configurations in the route files.
ElegantRouter is a tool for creating routes based on the file system, which can automatically generate route definitions, route file imports and route-related type definitions. Just create the route file according to the agreed rules, without adding any additional configuration in the route file.

### Differences and similarities

The similarities and differences between ElegantRouter and other file system based route tools are as follows:
The main difference between ElegantRouter and other file system-based routing tools is that:

1. Other file-based route tools have a lot of configuration conventions and black-box route data, which makes it difficult to customize.
2. ElegantRouter still follows the api-first principle, but only automates the process of configuring routes.
1. Other tools have complex configuration rules, and the route data is a black box, which is difficult to customize.
2. ElegantRouter follows the api-first principle and automates the process of configuring routes.

### The traditional route configuration process
Taking configuring Vue routes as an example, the traditional way of creating page routes requires the following steps:

Take the process of configuring Vue routes as an example. To create a page route, you need to go through the following steps:
1. Import the layout component
2. Import the page component
3. Define the route in the route configuration file

1. import the layout component
2. import the page component
3. Define the route in the route configuration file.

**Disadvantage:**

- The above steps, while not seemingly complicated, are repeated during actual development and need to be done manually each time.
- Maintenance of route names and paths is very cumbersome
- There is no clear convention on route definition for layout and page components, which leads to confusion in route definition
Although these steps are not complicated, in actual development, they are repetitive and need to be done manually. In addition, the maintenance of route names and paths is very troublesome, there is no clear agreement on the route definition of the layout and page components, resulting in a messy route definition.
And using ElegantRouter, you only need to create the route file according to the agreed rules, you can automatically generate the route in the specified route file.

### ElegantRouter's route configuration process

Expand Down
21 changes: 8 additions & 13 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,27 @@

## 介绍

ElegantRouter 是一个基于文件系统创建路由的工具,能够直接自动生成路由的定义、路由文件的导入以及路由相关的类型定义,只需要按照约定的规则创建路由文件即可,不需要在路由文件中写入任何额外的配置
ElegantRouter 是一个基于文件系统创建路由的工具,它能自动化生成路由定义、路由文件导入以及路由相关的类型定义。只需按照约定的规则创建路由文件,无需在路由文件中添加任何额外配置

### 异同点

ElegantRouter 与其他基于文件系统的路由工具的异同点如下
ElegantRouter 与其他基于文件系统的路由工具的主要区别在于

1. 其他基于文件系统的路由工具约定配置繁多,路由数据为黑盒,自定义难度大
2. ElegantRouter 仍然遵循的是api-first的原则,只是把配置路由的过程自动化
1. 其他工具的配置规则繁多,路由数据为黑盒,自定义难度大
2. ElegantRouter 遵循api-first原则,将配置路由的过程自动化。

### 传统的路由配置过程

这里拿配置Vue路由的过程为例,要创建一个页面路由需要经历以下的步骤:
以配置Vue路由为例,传统的创建页面路由需要以下步骤:

1. 导入布局组件
2. 导入页面组件
3. 在路由配置文件中定义路由

**缺点:**

- 上述的步骤虽然看起来不算复杂,但是在实际的开发过程中,这些步骤都是重复的,而且每次都需要手动完成。
- 路由名称和路径的维护是非常麻烦
- 对布局和页面组件的路由定义没有明确的约定,导致路由定义的混乱
这些步骤虽然不复杂,但在实际开发中,它们是重复且需要手动完成的。此外,路由名称和路径的维护非常麻烦,对布局和页面组件的路由定义没有明确的约定,导致路由定义混乱。
而使用ElegantRouter,你只需要按照约定的规则创建路由文件,即可在指定的路由文件中自动生成路由。

### ElegantRouter 的路由配置过程

只需要按照约定的规则创建路由文件即可在指定的路由文件中生成该该路由
只需要按照约定的规则创建路由文件即可在指定的路由文件中生成该路由

## 安装

Expand Down

0 comments on commit ea2a1f9

Please sign in to comment.