外观
对象解析
约 74 字小于 1 分钟
2026-02-08
objectResolve(input: any, currentDepth = 10): any
递归解析对象或数组中的的所有模板, 不管是key还是value, 都进行解析.
import mock from "@erhai_lake/mock-service"
console.log(mock.resolveDeep({
"a": "{{$string.uuid}}",
"b": {
"a": "{{$string.uuid}}",
"b": {
"a": "{{$string.uuid}}",
"b": {
"a": "{{$string.uuid}}",
"b": {},
"{{$string.uuid}}": "a"
},
"{{$string.uuid}}": "a"
},
"{{$string.uuid}}": "a"
},
"{{$string.uuid}}": "a"
}, 1))版权所有
版权归属:Erhai-lake