Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit221a848

Browse files
authored
Merge pull request#1509 from lowcoder-org/fix/global_unique_variable_name
Make the variable name unique among editorState
2 parents296e25b +0e64a0e commit221a848

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎client/packages/lowcoder/src/comps/comps/simpleVariableHeaderComp.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import{ControlParams}from"comps/controls/controlParams";
2+
import{EditorContext}from"comps/editorState";
23
import{CompAction,SimpleComp}from"lowcoder-core";
34
import{ControlPropertyViewWrapper,PopupCard,Input}from"lowcoder-design";
4-
import{useEffect,useState}from"react";
5+
import{useContext,useEffect,useState}from"react";
56
import{trans}from"i18n";
6-
import{checkName}from"../utils/rename";
77
constSimpleVariableHeaderPropertyView=({params, comp, isCheck}:any)=>{
88
const[error,setError]=useState<string|undefined>();
99
const[value,setValue]=useState(comp.value);
10+
consteditorState=useContext(EditorContext);
1011
useEffect(()=>{
1112
setValue(comp.value);
1213
isCheck&&setError(undefined);
@@ -17,7 +18,7 @@ const SimpleVariableHeaderPropertyView = ({params, comp, isCheck}: any) => {
1718
value={value}
1819
placeholder={params.placeholder}
1920
onChange={(e)=>{
20-
consterror=isCheck&&checkName(e.target.value);
21+
consterror=isCheck&&editorState.checkRename(value,e.target.value);
2122
isCheck&&setError(error||undefined);
2223
setValue(e.target.value);
2324
}}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp