fix(client): fix variable component label (#8988)

This commit is contained in:
Junyi
2026-03-29 23:42:15 +08:00
committed by GitHub
parent 84c09a531a
commit c42accaaa9
2 changed files with 2 additions and 2 deletions
@@ -39,7 +39,7 @@ function parseValue(value: any, options: ParseOptions = {}): string | string[] {
if (type === 'string') {
const matched = value.match(JT_VALUE_RE);
if (matched) {
return matched[1].split('.');
return matched[1].trim().split('.');
}
if (options.stringToDate) {
if (!Number.isNaN(Date.parse(value))) {
@@ -236,7 +236,7 @@ function useVariablesFromValue(value: string, delimiters: [string, string] = ['{
}
const variableRegExp = new RegExp(`${delimiters[0]}\\s*([^{}]+)\\s*${delimiters[1]}`, 'g');
const matches = value.match(variableRegExp);
return matches?.map((m) => m.replace(variableRegExp, '$1')) ?? [];
return matches?.map((m) => m.replace(variableRegExp, '$1').trim()) ?? [];
}, [value, delimitersString]);
}