typescript 动态给class添加方法
生活随笔
收集整理的這篇文章主要介紹了
typescript 动态给class添加方法
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
interface String {logit(): void;
}String.prototype.logit = function () {console.log(this);
}let a = "string";
a.logit();
總結(jié)
以上是生活随笔為你收集整理的typescript 动态给class添加方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 浅谈拓扑排序
- 下一篇: ajax struts2 乱码,stru