mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-04-06 21:40:23 +08:00
fix parseExpression bug
This commit is contained in:
parent
ae564e926b
commit
6566734282
@ -8,6 +8,7 @@ describe('parseExpression function', () => {
|
||||
expect(parseExpression('Hello, {{ value }}!')).toMatchObject([
|
||||
{ expression: 'Hello, ', isDynamic: false },
|
||||
{ expression: 'value', isDynamic: true },
|
||||
{ expression: '!', isDynamic: false },
|
||||
]);
|
||||
expect(
|
||||
parseExpression('{{ $listItem.name }} is in {{ root.listTitle }} list')
|
@ -70,7 +70,7 @@ export function parseExpression(
|
||||
}
|
||||
}
|
||||
|
||||
if (r > l) {
|
||||
if (r >= l && l < str.length) {
|
||||
res.push({
|
||||
expression: str.substring(l, r + 1),
|
||||
isDynamic: false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user