mirror of
https://github.com/MrXujiang/h5-Dooring.git
synced 2026-01-10 22:18:10 +00:00
fix: 1、默认左侧展开 2、拖拽控件,右侧展开
This commit is contained in:
parent
783849a542
commit
2fbab8881b
@ -43,7 +43,7 @@ const Container = (props: {
|
||||
dispatch?: any;
|
||||
}) => {
|
||||
const [scaleNum, setScale] = useState(1);
|
||||
const [collapsed, setCollapsed] = useState(true);
|
||||
const [collapsed, setCollapsed] = useState(false);
|
||||
const [rightColla, setRightColla] = useState(true);
|
||||
const { pstate, cstate, dispatch } = props;
|
||||
const pointData = pstate ? pstate.pointData : [];
|
||||
@ -193,6 +193,11 @@ const Container = (props: {
|
||||
} //待修改
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
if (pstate.curPoint && pstate.curPoint.status === 'inToCanvas' && rightColla) {
|
||||
changeRightColla(false);
|
||||
}
|
||||
}, [pstate.curPoint]);
|
||||
|
||||
const allType = useMemo(() => {
|
||||
let arr: string[] = [];
|
||||
|
||||
@ -55,6 +55,7 @@ const SourceBox = memo((props: SourceBoxProps) => {
|
||||
id: uuid(6, 10),
|
||||
item,
|
||||
point: { i: `x-${pointData.length}`, x: 0, y: gridY, w, h: item.h, isBounded: true },
|
||||
status: 'inToCanvas',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
@ -71,6 +72,7 @@ const SourceBox = memo((props: SourceBoxProps) => {
|
||||
h: item.h,
|
||||
isBounded: true,
|
||||
},
|
||||
status: 'inToCanvas',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,3 +1,11 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Version: 2.0
|
||||
* @Autor: dragon
|
||||
* @Date: 2020-09-24 10:11:24
|
||||
* @LastEditors: dragon
|
||||
* @LastEditTime: 2020-10-08 16:12:26
|
||||
*/
|
||||
const pointData = localStorage.getItem('userData') || '[]';
|
||||
|
||||
function overSave(name, data) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user