vue 枚举类
class Enum {constructor(key,val) {this.#key = key;this.#val= val;}/*** 枚举类型的key*/#key;/*** 枚举类型的值*/#val;get val() {return this.#val;}}export class SystemMessageEnum{#map = new Map();constructor() .
·
class Enum {
constructor(key,val) {
this.#key = key;
this.#val = val;
}
/**
* 枚举类型的key
*/
#key;
/**
* 枚举类型的值
*/
#val;
get val() {
return this.#val;
}
}
export class SystemMessageEnum {
#map = new Map();
constructor() {
this.enums("TRADE",new Enum(1,"交易通知"));
this.enums("BINDDING",new Enum(2,"竞标消息"));
this.enums("NOTICE",new Enum(3,"系统通知"));
this.enums("ACTIVITY",new Enum(4,"优惠活动"));
this.enums("PAY",new Enum(5,"收费通知"));
}
val(key) {
return this.#map[key];
}
enums(type,content) {
console.log(type)
console.log(content)
this.#map[type] = content;
}
}
更多推荐
已为社区贡献1条内容
所有评论(0)