我有一個側面板。我正在嘗試關閉用戶操作的側面板。但是,我在此操作中遇到了錯誤。
Property 'close' does not exist on type 'MatSlidePanel'.ts(2339)
這是我嘗試過的代碼:ts檔案
constructor(
public slidePanel: MatSlidePanel,
) { }
onClose(): void {
this.slidePanel.close();
}
uj5u.com熱心網友回復:
在源代碼中如果 ngx-mat-slide-panel ( https://github.com/mandhu/angular-components/blob/master/projects/mat-slide-panel/src/lib/mat-slide-panel.ts ) 你可以看到該函式被呼叫dismiss()而不是close()。因此,您可能應該使用此功能再次關閉側面板。
盡管如此,這讓我想知道您是否沒有諸如自動完成之類的東西。通常你應該得到關于存在哪些函式或屬性可用的提示。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/526326.html
標籤:jQuery有角度的
上一篇:在字串引號內列印變數值
