标签:aaa str ict bsp 实现 ber number div span
这里可借助字符串索引
可用于interface与type
interface Dic<T> {
[index:string]: T
}
let d1:Dic<string>= {‘a‘: ‘aaa‘, ‘b‘: ‘bbb‘}
interface NumDic<T> {
[index:number]: T
}
let d1:NumDic<string>= {1: ‘aaa‘, 2: ‘bbb‘}
实现Dictionary、NumericDictionary
标签:aaa str ict bsp 实现 ber number div span
原文地址:https://www.cnblogs.com/yanze/p/12248523.html