共用方式為


活動

提供呼叫 PCF 中定義事件的方法。 針對畫布應用程式,製作者會使用 Power Fx 來設定這些事件。 對於模型導向應用程式,開發人員會使用 JavaScript 描述事件

適用於

畫布應用程式和模型導向應用程式

語法

context.events

Methods

資訊清單檔案中的事件節點建置為物件中的context.events可呼叫方法。

定義事件

Example

return (
  <Button
    onClick={() => {
      context.events.OnCustomEvent();
    }}
  />
);

Power Apps 元件架構 API 參考
Power Apps 元件架構概觀