|
@@ -29,58 +29,58 @@ export default defineUI({
|
|
|
const pageRoot = helper.findRootComp();
|
|
|
if (!pageRoot) return;
|
|
|
return (
|
|
|
- <div class="flex justify-center my-60px ">
|
|
|
- <CompUI.Page.Component class={contentStyle} compId={pageRoot.id}>
|
|
|
- {{
|
|
|
- Container(children: any) {
|
|
|
- return (
|
|
|
- <>
|
|
|
- <Container
|
|
|
- class={store.isEditPage ? "!min-h-750px" : ""}
|
|
|
- group-name="canvas"
|
|
|
- onDrop={(e: any) => {
|
|
|
- if (e.payload) {
|
|
|
- actions.addCompToDesign(e.payload, e.addedIndex);
|
|
|
- } else {
|
|
|
- actions.moveComp(e.removedIndex, e.addedIndex);
|
|
|
- }
|
|
|
- }}
|
|
|
- onDragStart={() => (state.draging = true)}
|
|
|
- onDragEnd={() => (state.draging = false)}
|
|
|
- non-drag-area-selector={".drag-disable"}
|
|
|
- >
|
|
|
- {children}
|
|
|
- </Container>
|
|
|
- {store.currCompId &&
|
|
|
- store.currCompId !== "root" &&
|
|
|
- !store.textEditingState &&
|
|
|
- !state.draging && <Transfer key={store.currCompId} />}
|
|
|
- </>
|
|
|
- );
|
|
|
- },
|
|
|
- CompItem(comp: DesignComp) {
|
|
|
- const Comp =
|
|
|
- controls.compUICtrl.state.components.get(comp.compKey)
|
|
|
- ?.Component || NotFoundComp;
|
|
|
- return (
|
|
|
- <Draggable class="!flex flex-col" key={comp.id}>
|
|
|
- <Comp compId={comp.id} />
|
|
|
- </Draggable>
|
|
|
- );
|
|
|
- },
|
|
|
- }}
|
|
|
- </CompUI.Page.Component>
|
|
|
+ <div class="scrollbar overflow-y-auto h-1/1">
|
|
|
+ <div class={"w-375px my-60px mx-auto select-none " + contentCls}>
|
|
|
+ <CompUI.Page.Component
|
|
|
+ class={store.isEditPage ? "!min-h-750px" : ""}
|
|
|
+ compId={pageRoot.id}
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ Container(children: any) {
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <Container
|
|
|
+ group-name="canvas"
|
|
|
+ onDrop={(e: any) => {
|
|
|
+ if (e.payload) {
|
|
|
+ actions.addCompToDesign(e.payload, e.addedIndex);
|
|
|
+ } else {
|
|
|
+ actions.moveComp(e.removedIndex, e.addedIndex);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ onDragStart={() => (state.draging = true)}
|
|
|
+ onDragEnd={() => (state.draging = false)}
|
|
|
+ non-drag-area-selector={".drag-disable"}
|
|
|
+ >
|
|
|
+ {children}
|
|
|
+ </Container>
|
|
|
+ {store.currCompId &&
|
|
|
+ store.currCompId !== "root" &&
|
|
|
+ !store.textEditingState &&
|
|
|
+ !state.draging && <Transfer key={store.currCompId} />}
|
|
|
+ </>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ CompItem(comp: DesignComp) {
|
|
|
+ const Comp =
|
|
|
+ controls.compUICtrl.state.components.get(comp.compKey)
|
|
|
+ ?.Component || NotFoundComp;
|
|
|
+ return (
|
|
|
+ <Draggable class="!flex flex-col" key={comp.id}>
|
|
|
+ <Comp compId={comp.id} />
|
|
|
+ </Draggable>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ }}
|
|
|
+ </CompUI.Page.Component>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
);
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
|
|
|
-const contentStyle = css`
|
|
|
- width: 375px;
|
|
|
- position: relative;
|
|
|
- user-select: none;
|
|
|
-
|
|
|
+const contentCls = css`
|
|
|
.dndrop-container.vertical > .dndrop-draggable-wrapper {
|
|
|
overflow: unset;
|
|
|
}
|