Skip to content

Commit 94abb24

Browse files
committed
doc
1 parent ceb3329 commit 94abb24

File tree

1 file changed

+64
-24
lines changed

1 file changed

+64
-24
lines changed

readme.md

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
让处理表单返回值变得更容易!
66

7-
需要已编译好的版本?去看看 [Releases](https://github.com/lgc-LLSEDev/FormAPIEx/releases) 吧!
8-
97
## 介绍
108

119
本工具库提供了一些类以及函数,可以让各位更方便地处理表单返回值,不用再为需要自己处理表单按钮的 ID 而烦恼了!
@@ -20,13 +18,53 @@
2018

2119
## 引用
2220

23-
### QuickJS
21+
<details open>
22+
<summary>LL3 用法</summary>
2423

25-
- 将编译好的 `FormAPIEx.js` 扔进 BDS 目录的 `plugins/lib` 文件夹中,之后使用下面的代码来导入
24+
### LL3 - QuickJS
25+
26+
- 将本仓库作为 Lip 包安装到 BDS 的插件目录:
27+
28+
```bash
29+
lip install github.com/lgc-LLDev/FormAPIEx
30+
```
31+
32+
或者作为你插件的依赖:
33+
34+
```jsonc
35+
// tooth.json
36+
{
37+
// ...
38+
"dependencies": {
39+
"github.com/lgc-LLDev/FormAPIEx": ">0.0.0" // 自行修改依赖版本
40+
// ...
41+
}
42+
// ...
43+
}
44+
```
45+
46+
- 之后使用 `require` 导入(没有试过能不能用 ES6 语法,可以自行尝试):
2647

2748
```js
2849
// 可以接着导入其他本库已经导出的函数,类等
29-
const { CustomFormEx } = require('./lib/FormAPIEx');
50+
const { CustomFormEx } = require('./FormAPIEx');
51+
```
52+
53+
### LL3 - Rollup
54+
55+
参见下方 `LL2 - NodeJS` 的用法
56+
57+
</details>
58+
59+
<details>
60+
<summary>LL2 用法</summary>
61+
62+
### LL2 - QuickJS
63+
64+
- 将编译好的 `FormAPIEx.js` 扔进 BDS 目录的 `plugins/lib` 文件夹中,之后使用下面的代码来导入
65+
66+
```js
67+
3068
```
3169

3270
如果你使用的是 TypeScript,那么我更推荐你使用模块语法导入
@@ -36,33 +74,35 @@
3674
import { CustomFormEx } from './lib/FormAPIEx';
3775
```
3876

39-
### NodeJS
77+
### LL2 - NodeJS
78+
79+
#### 引用 `form-api-ex` npm 包
4080

41-
- 引用 `form-api-ex` npm 包
81+
- 先将本包加入你项目的依赖项中
4282

43-
- 先将本包加入你项目的依赖项中
83+
推荐使用 `pnpm` 管理项目依赖
84+
下面的命令假设你已经安装了 `pnpm`,如果你没有安装,可以往上翻翻看看如何安装,也可以换用其他包管理器
85+
使用下面的命令将本包添加到你项目的依赖项中
4486

45-
推荐使用 `pnpm` 管理项目依赖
46-
下面的命令假设你已经安装了 `pnpm`,如果你没有安装,可以往上翻翻看看如何安装,也可以换用其他包管理器
47-
使用下面的命令将本包添加到你项目的依赖项中
87+
```bash
88+
pnpm i form-api-ex
89+
```
4890

49-
```bash
50-
pnpm i form-api-ex
51-
```
91+
- 然后使用下面的语法导入
5292

53-
- 然后使用下面的语法导入
93+
```js
94+
// 可以接着导入其他本库已经导出的函数,类等
95+
const { CustomFormEx } = require('form-api-ex');
96+
```
5497

55-
```js
56-
// 可以接着导入其他本库已经导出的函数,类等
57-
const { CustomFormEx } = require('form-api-ex');
58-
```
98+
如果你使用的是 TypeScript,那么我更推荐你使用模块语法导入
5999

60-
如果你使用的是 TypeScript,那么我更推荐你使用模块语法导入
100+
```ts
101+
// 可以接着导入其他本库已经导出的函数,类,接口等
102+
import { CustomFormEx } from 'form-api-ex';
103+
```
61104

62-
```ts
63-
// 可以接着导入其他本库已经导出的函数,类,接口等
64-
import { CustomFormEx } from 'form-api-ex';
65-
```
105+
</details>
66106

67107
## 联系我
68108

0 commit comments

Comments
 (0)