|
@@ -38,27 +38,61 @@ class pageConfig {
|
|
|
const isVue = fs.existsSync(nameVue);
|
|
|
const isJs = fs.existsSync(nameJs);
|
|
|
if (isVue && isJs) continue;
|
|
|
-
|
|
|
+ const conf = pageJSON[v]['conf'] ? JSON.stringify(pageJSON[v]['conf']) : ''
|
|
|
const templateVue = `
|
|
|
- <template>
|
|
|
- <div class="${v}"></div>
|
|
|
- </template>
|
|
|
- <script setup>
|
|
|
- // import { onMounted, reactive } from "vue";
|
|
|
- // import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
|
|
|
- /**
|
|
|
- * window.$originData.orginParames.title 页面标题
|
|
|
- * window.$originData.orginParames.parameters 固定参数值
|
|
|
- * window.$originData.urlParames url参数
|
|
|
- */
|
|
|
- console.log(window.$originData)
|
|
|
- </script>
|
|
|
- <style>
|
|
|
- .${v} {
|
|
|
- width: 100vw;
|
|
|
- height: 100vh;
|
|
|
- }
|
|
|
- </style>
|
|
|
+<template>
|
|
|
+ <van-swipe class="my-swipe" indicator-color="white">
|
|
|
+ <template v-for="(item, index) in page.hoversList" :key="index">
|
|
|
+ <van-swipe-item>
|
|
|
+ <div class="pageItem" :style="{background: item.background_url}">
|
|
|
+ <component
|
|
|
+ v-for="(v, i) in item.components"
|
|
|
+ :key="'son' + index + i"
|
|
|
+ :is="components[v.type]"
|
|
|
+ :item="v"
|
|
|
+ ></component>
|
|
|
+ </div>
|
|
|
+ </van-swipe-item>
|
|
|
+ </template>
|
|
|
+ </van-swipe>
|
|
|
+</template>
|
|
|
+<script setup>
|
|
|
+// import { onMounted, reactive } from "vue";
|
|
|
+import { ref } from 'vue';
|
|
|
+// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
|
|
|
+
|
|
|
+import localImage from '../../components/image.vue';
|
|
|
+import localParagraph from '../../components/paragraph.vue';
|
|
|
+import localFromComponent from '../../components/fromComponent.vue';
|
|
|
+/**
|
|
|
+ * window.$originData.orginParames.title 页面标题
|
|
|
+ * window.$originData.orginParames.parameters 固定参数值
|
|
|
+ * window.$originData.urlParames url参数
|
|
|
+ */
|
|
|
+console.log(window.$originData);
|
|
|
+const page = ref(${conf});
|
|
|
+const components = {
|
|
|
+ image: localImage,
|
|
|
+ paragraph: localParagraph,
|
|
|
+ fromComponent: localFromComponent,
|
|
|
+};
|
|
|
+
|
|
|
+ document.title = page.value.title;
|
|
|
+
|
|
|
+</script>
|
|
|
+<style>
|
|
|
+.page {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+}
|
|
|
+.pageItem{
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|
|
|
+
|
|
|
`;
|
|
|
const templateJS = `
|
|
|
import App from './index.vue'
|