当前位置: 首页 > Web前端 > vue.js

typescript如何扩展原生数据结构;

时间:2023-03-31 18:22:41 vue.js

//type.d.ts(globalscope)declareglobal{interfaceArray{customFunc(args)=>any;}}//type.tsArray.prototype.customFunc=(...args)=>{return}PS:在此基础上补充泛型会让这个更完美