|
@@ -1,4 +1,4 @@
|
|
|
-import { defineComponent } from "vue";
|
|
|
+import { defineComponent , reactive} from "vue";
|
|
|
import { string } from "vue-types";
|
|
|
import { useCompData } from ".";
|
|
|
import { useEditor } from "../../../..";
|
|
@@ -13,21 +13,35 @@ export const Component = defineComponent({
|
|
|
},
|
|
|
setup(props, { slots }) {
|
|
|
const editor = useEditor();
|
|
|
- const { helper } = editor;
|
|
|
+ const { helper, store } = editor;
|
|
|
const compRef = useCompRef(props.compId);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return () => {
|
|
|
- const { children, layout, value } = useCompData(props.compId);
|
|
|
+ const comp = useCompData(props.compId);
|
|
|
+ const { children, layout, value } = comp;
|
|
|
const compMusic = value.music || "";
|
|
|
const curValue = MusicOptions.find((e) => {
|
|
|
return e.value == compMusic;
|
|
|
});
|
|
|
+ const style = helper.createStyle(layout || { size: [750] }, comp);
|
|
|
+ if (comp.value.pageMode == "short") {
|
|
|
+ style.height = "100%";
|
|
|
+ }
|
|
|
+
|
|
|
+ const contextStyle:any = { transform: `translate(0, ${ -store.shortPage.index * window.innerHeight + store.shortPage.offset}px`};
|
|
|
+ if (!store.shortPage.isMoving) {
|
|
|
+ contextStyle.transition = "transform .4s ease-out";
|
|
|
+ }
|
|
|
+
|
|
|
return (
|
|
|
<div
|
|
|
ref={compRef}
|
|
|
- style={helper.createStyle(layout || { size: [750] })}
|
|
|
- class={["!h-auto", editor.store.isEditMode ? pageEditStyle : ""]}
|
|
|
+ style={style}
|
|
|
+ class={[comp.value.pageMode != "short" && "!h-auto", editor.store.isEditMode ? pageEditStyle : ""]}
|
|
|
>
|
|
|
- <div class="relative z-1000">
|
|
|
+ <div class="relative z-1000" style={contextStyle}>
|
|
|
{slots.Container?.(
|
|
|
children.default.map((compId) => {
|
|
|
const comp = helper.findComp(compId);
|