Merge pull request #8238 from igrowp/fix-textarea-formula

fix: 调整tpl输入框表达式匹配规则
This commit is contained in:
hsm-lv 2023-09-25 19:43:47 +08:00 committed by GitHub
commit a796efbb06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -14,6 +14,7 @@ import FormulaPicker, {CustomFormulaPickerProps} from './FormulaPicker';
import {reaction} from 'mobx';
import {renderFormulaValue} from '../FormulaControl';
import {getVariables} from 'amis-editor-core';
import {findDOMNode} from 'react-dom';
export interface AdditionalMenuClickOpts {
/**
@ -445,7 +446,7 @@ export class TextareaFormulaControl extends React.Component<
data-position="top"
onClick={this.handleFormulaClick}
>
<Icon icon="function" className="icon" />
<Icon icon="input-add-fx" className="icon" />
</a>
)}
</li>
@ -487,6 +488,7 @@ export class TextareaFormulaControl extends React.Component<
) : null}
<TooltipWrapper
container={() => findDOMNode(this) as HTMLElement}
trigger="hover"
placement="top"
style={{fontSize: '12px'}}

View File

@ -126,8 +126,8 @@ export class FormulaPlugin {
for (let index = 0; index < charArr.length; index++) {
const char = charArr[index];
if (char === '$' && charArr[index + 1] === '{') {
cache.push('${');
if (char === '{') {
cache.push('{');
} else if (char === '}') {
cache.pop();
}