مشاركة عبر


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
نظرة عامة على إطار عمل مكون Power Apps