mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
修正非tabs展示模式下出现多余「self」标签问题 (#4579)
* docs: 修复线上bug,内外网都发一版 1.9.1-beta.21 * fix(inputFormula): 修正非tabs展示模式下出现多余「self」标签问题
This commit is contained in:
parent
db77dc3cac
commit
00bcca021b
@ -239,7 +239,7 @@ export class FormulaEditor extends React.Component<
|
||||
handleVariableSelect(item: VariableItem) {
|
||||
const {evalMode, selfVariableName} = this.props;
|
||||
|
||||
if (item && item.value && selfVariableName === item.value) {
|
||||
if (item && item.value && (selfVariableName && selfVariableName === item.value)) {
|
||||
toast.warning('不能使用当前变量[self],避免循环引用。');
|
||||
return;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ function VariableList(props: VariableListProps) {
|
||||
: (option: Option, states: ItemRenderStates): JSX.Element => {
|
||||
return (
|
||||
<span className={cx(`${classPrefix}-item`, itemClassName)}>
|
||||
{option.label && option.value === selfVariableName && (
|
||||
{option.label && (selfVariableName && option.value === selfVariableName) && (
|
||||
<Badge
|
||||
classnames={cx}
|
||||
badge={{
|
||||
@ -58,7 +58,7 @@ function VariableList(props: VariableListProps) {
|
||||
<label>{option.label}</label>
|
||||
</Badge>
|
||||
)}
|
||||
{option.label && option.value !== selfVariableName && (
|
||||
{option.label && (!selfVariableName || option.value !== selfVariableName) && (
|
||||
<label>{option.label}</label>
|
||||
)}
|
||||
{option?.tag ? (
|
||||
|
Loading…
Reference in New Issue
Block a user