Zdieľať cez


getResource

Vráti css, HTML alebo img prostriedok definovaný v manifeste súčasti.

K dispozícii pre

Modelom riadená aplikácia

Syntax

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

Parametre

Názov parametra Typ Požaduje sa Popis
Id String Áno Identifikátor reťazca zdroja.
úspech function (string) => void Nie Úspešný spätné volanie. Zdrojové údaje sa vrátia vo formáte s kódovaním Base-64.
zlyhanie function () => void Nie Spätné volanie o zlyhaní.

Príklad

 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();
    }
  }

Zdroje
Referenčné informácie k rozhraniam API architektúry súčastí služby Power Apps
Prehľad architektúry súčastí služby Power Apps