getResource

コンポーネント マニフェストで定義された CSS、HTML または img リソースを返します。

以下に使用できます

モデル駆動型アプリ

構文

context.resources.getResource(id, success, failure)

パラメーター

パラメーター名 必要な領域 内容
ID String はい リソースの文字列の識別子。
success function (string) => void いいえ 成功コールバック。 リソースのデータは Base 64 エンコード形式で返されます。
failure function () => void いいえ 失敗コールバック。

 private setDefaultImage(): void {
    this._context.resources.getResource(
      DefaultImageFileName,
      this.setImage.bind(this, false, "png"),
      this.showError.bind(this)
    );
    this.controlContainer.classList.add(NoImageClassName);
    // If it already has value, we need to update the output
    if (this._context.parameters.value.raw) {
      this._value = null;
      this._notifyOutputChanged();
    }
  }

Resources
Power Apps Component Framework API 参照
Power Apps Component Framework の概要

注意

ドキュメントの言語設定についてお聞かせください。 簡単な調査を行います。 (この調査は英語です)

この調査には約 7 分かかります。 個人データは収集されません (プライバシー ステートメント)。