|
@@ -1,6 +1,8 @@
|
|
|
<template>
|
|
|
<div class="H5Editor">
|
|
|
- <div class="H5Editor_left">1</div>
|
|
|
+ <div class="H5Editor_left">
|
|
|
+ <component v-show="H5Editor" :is="H5EditorObj[H5Editor.type]" :item="H5Editor"></component>
|
|
|
+ </div>
|
|
|
<div class="H5Editor_center">
|
|
|
<div class="pageClient">
|
|
|
<div class="page">
|
|
@@ -58,15 +60,27 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref } from 'vue';
|
|
|
+import { ref, provide } from 'vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
|
|
|
+// 中间显示模块组件
|
|
|
import H5Image from './components/H5Editor/img.vue';
|
|
|
import H5Paragraph from './components/H5Editor/paragraph.vue';
|
|
|
import H5FromComponent from './components/H5Editor/from.vue';
|
|
|
import H5VanField from './components/H5Editor/van_field.vue';
|
|
|
import H5VanButtom from './components/H5Editor/van_buttom.vue';
|
|
|
|
|
|
+// 左侧编辑模块组件
|
|
|
+import H5ImgEditor from "./components/H5Editor/imgEditor";
|
|
|
+
|
|
|
+const H5EditorObj = {
|
|
|
+ H5ImgEditor
|
|
|
+}
|
|
|
+const H5EditorObjEle = {
|
|
|
+ "image": "H5ImgEditor"
|
|
|
+}
|
|
|
+
|
|
|
+const H5Editor = ref({});
|
|
|
const route = useRoute();
|
|
|
const item = JSON.parse(route.query.item || '{}');
|
|
|
const selectPage = ref(0);
|
|
@@ -76,8 +90,6 @@ const selectPageFunc = (index = 0) => {
|
|
|
selectPage.value = index;
|
|
|
};
|
|
|
|
|
|
-console.log(hoversList.value);
|
|
|
-
|
|
|
// 查看页面大小,
|
|
|
const img = new Image();
|
|
|
img.src = hoversList.value[selectPage.value].background_url || '';
|
|
@@ -101,6 +113,21 @@ const backgroundStyle = () => {
|
|
|
const saveParagraph = (paragraph, index) => {
|
|
|
console.log(paragraph, index);
|
|
|
};
|
|
|
+
|
|
|
+// provide 传递方法
|
|
|
+provide('starEditorFormwork', value => {
|
|
|
+ const type = H5EditorObjEle[value.type];
|
|
|
+ value.type = type;
|
|
|
+ H5Editor.value = value;
|
|
|
+});
|
|
|
+
|
|
|
+provide("saveComponents", value => {
|
|
|
+ console.log(value);
|
|
|
+})
|
|
|
+
|
|
|
+provide("deleteItemComponents", value => {
|
|
|
+ console.log(value);
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
@@ -114,6 +141,7 @@ const saveParagraph = (paragraph, index) => {
|
|
|
.H5Editor {
|
|
|
background-color: #d0cfd8;
|
|
|
height: 100%;
|
|
|
+ min-width: 1200px;
|
|
|
}
|
|
|
|
|
|
.H5Editor_left,
|
|
@@ -124,7 +152,7 @@ const saveParagraph = (paragraph, index) => {
|
|
|
}
|
|
|
|
|
|
.H5Editor_center {
|
|
|
- width: calc(100% - 500px);
|
|
|
+ width: calc(100% - 600px);
|
|
|
position: relative;
|
|
|
}
|
|
|
|
|
@@ -159,7 +187,7 @@ const saveParagraph = (paragraph, index) => {
|
|
|
}
|
|
|
|
|
|
.H5Editor_left {
|
|
|
- width: 200px;
|
|
|
+ width: 300px;
|
|
|
background-color: #f3f3f3;
|
|
|
}
|
|
|
|
|
@@ -174,10 +202,9 @@ const saveParagraph = (paragraph, index) => {
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-.showList{
|
|
|
- box-sizing: border-box;
|
|
|
- border: 1px solid rgba(0,0,0,0);
|
|
|
- position: relative;
|
|
|
+.showList {
|
|
|
+ box-sizing: border-box;
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0);
|
|
|
+ position: relative;
|
|
|
}
|
|
|
</style>
|