标签:people int div turn 创建 highlight struct class 创建类型
class People {
static _name: string;
print() {
//alert(this.name);// 编译不通过,doex not exist on type People;声明为static的变量通过类名调用
return(People._name)
}
constructor(name){
People._name = name;
}
}
// let h = new People();
// // h.name = "aaa";
// People._name = "aaaa";
// h.print();
//创建类型,为当前类的类型(引用数据类型)
let p:People;
p = new People("aa");
alert(p.print())
标签:people int div turn 创建 highlight struct class 创建类型
原文地址:https://www.cnblogs.com/allyh/p/10680130.html