中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
try { getContext(this).resourceManager.getRawFileContent("MapData.json", (error: BusinessError, value: Uint8Array) => { const textDecoder = util.TextDecoder.create("utf-8"); const res = textDecoder.decodeWithStream(value, { stream: false }); this.sections = JSON.parse(res); });} catch (error) { console.error(`callback getRawFileContent failed, error is ${JSON.stringify(error)}`)}
捕获错误 callback getRawFileContent failed, error is {}
从学堂直接拉取的代码
微信扫码分享