Condividi tramite


getResource

Restituisce una risorsa CSS, HTML o img definita nel manifesto del componente.

Disponibile per

App basate su modello

Sintassi

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

Parametri

Nome del parametro TIPO Obbligatorio Description
id String Yes Identificatore della stringa di risorsa.
successo function (string) => void NO Callback riuscito. I dati delle risorse vengono restituiti in formato con codifica base 64.
fallimento function () => void NO Callback di errore.

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

Risorse
Informazioni di riferimento sulle API del framework dei componenti di Power Apps
Panoramica del framework dei componenti di Power Apps