mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-19 02:23:00 +08:00
fix(client): fix variable component label (#8988)
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user