Commit 76d99891 authored by nanahira's avatar nanahira

problems with union

parent 9cc9089e
...@@ -179,7 +179,7 @@ export class YGOProCard implements YGOProCardLike { ...@@ -179,7 +179,7 @@ export class YGOProCard implements YGOProCardLike {
} }
getDisplayString(config: YGOCardConfig) { getDisplayString(config: YGOCardConfig) {
const view = this.getView(config.lang); const view = this.getView(config.getLang());
const lines: string[] = []; const lines: string[] = [];
if (config.displayPic) { if (config.displayPic) {
lines.push( lines.push(
......
...@@ -17,14 +17,24 @@ export class YGOCardConfig { ...@@ -17,14 +17,24 @@ export class YGOCardConfig {
}) })
databasePaths: string[]; databasePaths: string[];
@DefineSchema({ type: 'number', default: 100, description: '查询最多显示的数量' }) @DefineSchema({
type: 'number',
default: 100,
description: '查询最多显示的数量',
})
matchCount: number; matchCount: number;
@DefineSchema({ @DefineSchema({
type: Schema.union(['cn', 'en']).description('显示语言').default('cn'), type: String,
description: '显示语言',
default: 'cn',
}) })
lang: 'cn' | 'en'; lang: 'cn' | 'en';
getLang() {
return this.lang === 'en' ? 'en' : 'cn';
}
@DefineSchema({ type: 'boolean', description: '是否展示卡图', default: true }) @DefineSchema({ type: 'boolean', description: '是否展示卡图', default: true })
displayPic: boolean; displayPic: boolean;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment