打字稿 - 界面中的默认功能 - >错误(TS)预期的属性或签名

时间:2018-06-18 00:52:16

标签: typescript

interface interfaceForm {
    controller: string;
    data: object;
    beforeSend: () => {
        document.getElementById("loading").style.display = "none";
    };
    done: () => {};
    fail: () => {};
}

在第5行中发生错误(TS)属性或期望签名

1 个答案:

答案 0 :(得分:4)

  

界面

中的默认功能

接口是仅编译时构造。您不能在界面中拥有实施

建议

考虑使用abstract class