當要從 DOM 樹狀結構中移除元件時,會呼叫這個方法。 使用它來清理並釋放元件正在使用的任何記憶體。
適用於
模型導向應用程式、畫布應用程式和入口網站。
語法
destroy()
Example
public destroy(): void
{
this.button.removeEventListener("click", this.onButtonClick);
}
當要從 DOM 樹狀結構中移除元件時,會呼叫這個方法。 使用它來清理並釋放元件正在使用的任何記憶體。
模型導向應用程式、畫布應用程式和入口網站。
destroy()
public destroy(): void
{
this.button.removeEventListener("click", this.onButtonClick);
}