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>