mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-11-06 17:25:24 +00:00
优化属性为枚举类型时变为Select选项
This commit is contained in:
@@ -493,13 +493,16 @@ export class ImageData extends Info {
|
||||
}
|
||||
|
||||
export class EnumData extends Info {
|
||||
public data: string | number = 0;
|
||||
public values: Array<{ name: string; value: any }> = [];
|
||||
constructor() {
|
||||
constructor(data: string | number = 0) {
|
||||
super();
|
||||
this.type = DataType.Enum;
|
||||
this.data = data;
|
||||
}
|
||||
parse(data: EnumData) {
|
||||
super.parse(data);
|
||||
this.data = data.data;
|
||||
for (let i = 0; i < data.values.length; i++) {
|
||||
const item = data.values[i];
|
||||
this.values.push({ name: item.name, value: item.value });
|
||||
|
||||
Reference in New Issue
Block a user