के माध्यम से साझा करें


getResource

घटक मैनिफ़ेस्ट में परिभाषित CSS, HTML या img संसाधन लौटाता है.

के लिए उपलब्ध है

मॉडल-चालित ऐप

सिंटैक्स

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

पैरामीटर

पैरामीटर नाम प्रकार आवश्य विवरण
परिचय String हां संसाधन स्ट्रिंग पहचानकर्ता.
सफलता function (string) => void नहीं सफलता कॉलबैक। संसाधन डेटा आधार 64 एन्कोडेड स्वरूप में दिया जाता है।
विफलता 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();
    }
  }

संसाधन
Power Apps घटक फ़्रेमवर्क API संदर्भ
Power Apps घटक फ़्रेमवर्क अवलोकन