diff --git a/internal-plugins/setting/src/components/common/CommandTag/CommandTag.vue b/internal-plugins/setting/src/components/common/CommandTag/CommandTag.vue index aaace254..0e0fdeed 100644 --- a/internal-plugins/setting/src/components/common/CommandTag/CommandTag.vue +++ b/internal-plugins/setting/src/components/common/CommandTag/CommandTag.vue @@ -7,7 +7,7 @@ interface Command { name?: string type?: 'text' | 'regex' | 'over' | 'img' | 'files' | 'window' | string match?: { - match?: string + match?: string | Record minLength?: number maxLength?: number extensions?: string[] @@ -32,6 +32,22 @@ const tagClass = computed(() => { // 否则使用 props.type return props.type ? `tag-${props.type}` : '' }) + +function getMinLength(command?: Command): number { + return command?.match?.minLength ?? 1 +} + +function getMaxLength(command?: Command): number { + return command?.match?.maxLength ?? 10000 +} + +function getExtensions(command?: Command): string[] { + return command?.match?.extensions ?? [] +} + +function getFileType(command?: Command): string | undefined { + return command?.match?.fileType +}