外观
获取某生成器的处理器信息组
约 183 字小于 1 分钟
2026-02-05
getGeneratorProcessorGroups(category: string, id: string): processorGroup[]
用来做前端展示时, 会很方便.
javascript
import mock from "@erhai_lake/mock-service"
const PROCESSOR_GROUPS = mock.getGeneratorProcessorGroups("string", "nanoid")
console.log(PROCESSOR_GROUPS)typescript
import mock, {type processorGroup} from "@erhai_lake/mock-service"
const PROCESSOR_GROUPS: processorGroup[] = mock.getGeneratorProcessorGroups("string", "nanoid")
console.log(PROCESSOR_GROUPS)返回
[
{
"id": "string",
"title": "字符串相关",
"description": "字符串相关的处理器",
"processor": [
{
"id": "substr",
"title": "截取子字符串",
"description": "截取字符串的子字符串",
"params": [
{
"id": "start",
"title": "截取开始位置",
"description": "截取的开始位置",
"type": "number",
"default": 0,
"min": 0,
"step": 1
},
{
"id": "length",
"title": "截取长度",
"description": "截取的长度",
"type": "number",
"default": 10,
"min": 0,
"step": 1
}
]
}
]
},
{
"id": "encodingDecoding",
"title": "编码解码",
"description": "编码解码相关的处理器",
"processor": []
}
]版权所有
版权归属:Erhai-lake