コンポーネント マニフェストで定義されている CSS、HTML、または img リソースを返します。
使用可能な対象
モデル駆動型アプリ
構文
context.resources.getResource(id, success, failure)
パラメーター
| パラメーター名 | タイプ | 必須 | Description |
|---|---|---|---|
| id | String |
イエス | リソース文字列識別子。 |
| 成功 | function (string) => void |
いいえ | 成功コールバック。 リソース データは、Base 64 でエンコードされた形式で返されます。 |
| 失敗 | function () => void |
いいえ | 失敗コールバック。 |
Example
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();
}
}
関連資料
リソース
Power Apps コンポーネント フレームワーク API リファレンス
Power Apps コンポーネント フレームワークの概要