代碼:
export class NumberInput extends HTMLElement {
constructor(...args: any) {
super(...args);
錯誤日志:
Error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.
(anonymous) @ example.js:1
任何建議!謝謝
uj5u.com熱心網友回復:
是的,正如 CatS 所說,ConstructorParameters是要走的路。
export class NumberInput extends HTMLElement {
constructor(...args: ConstructorParameters<typeof HTMLElement>) {
super(...args);
}
}
操場
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/510418.html
標籤:打字稿
下一篇:url中的角度面臨編碼問題
