mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
Merge pull request #8238 from igrowp/fix-textarea-formula
fix: 调整tpl输入框表达式匹配规则
This commit is contained in:
commit
a796efbb06
@ -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'}}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user