7.3 富文本组件的只读状态未生效
This commit is contained in:
@ -188,9 +188,6 @@ const BraftText: React.FC<WangType> = (props) => {
|
|||||||
/**一定要创建 */
|
/**一定要创建 */
|
||||||
editor.create();
|
editor.create();
|
||||||
|
|
||||||
//控制是否可编辑
|
|
||||||
disabled && makeDis();
|
|
||||||
|
|
||||||
willCreate = false;
|
willCreate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,6 +199,11 @@ const BraftText: React.FC<WangType> = (props) => {
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
//控制是否可编辑
|
||||||
|
disabled && makeDis();
|
||||||
|
}, [disabled])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// 重新设置编辑器内容
|
// 重新设置编辑器内容
|
||||||
echo && editor.txt.html(echo);
|
echo && editor.txt.html(echo);
|
||||||
@ -240,7 +242,7 @@ const BraftText: React.FC<WangType> = (props) => {
|
|||||||
|
|
||||||
//不可编辑
|
//不可编辑
|
||||||
function makeDis() {
|
function makeDis() {
|
||||||
editor.disable();
|
editor && editor.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
//form取值
|
//form取值
|
||||||
|
Reference in New Issue
Block a user