sea.getAsset(key[, encoding])


此方法可用于检索在构建时配置为打包到单一可执行应用中的资源。找不到匹配的资源时会抛出错误。

【This method can be used to retrieve the assets configured to be bundled into the single-executable application at build time. An error is thrown when no matching asset can be found.】

  • key <string> 在单可执行程序配置中由 assets 字段指定的字典中资源的键。
  • encoding <string> 如果指定,资源将作为字符串进行解码。接受 TextDecoder 支持的任何编码。 如果未指定,则返回包含资源副本的 ArrayBuffer
  • 返回: <string> | <ArrayBuffer>