add:添加预览逻辑

This commit is contained in:
lhj
2024-11-06 00:19:58 +08:00
parent 624eb717b9
commit 7db26561d0
2 changed files with 30 additions and 2 deletions

5
package-lock.json generated
View File

@ -2401,8 +2401,9 @@
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
"resolved": "https://repo.bingosoft.net/repository/npm/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"license": "MIT"
},
"node_modules/lsp-uuid": {
"version": "3.2.0",

27
preview/views/Preview.vue Normal file
View File

@ -0,0 +1,27 @@
<template>
<div v-if="!isEmpty(data)" class="box">
<template v-for="item in data" :key="item.id">
<!-- <component :is="componentsList[item.code]" :data="item"></component>-->
</template>
</div>
</template>
<script setup lang="ts">
import {onBeforeMount, shallowRef, ref} from "vue";
import {isEmpty} from "lodash";
import _ from "lodash";
const data = shallowRef<any>({});
onBeforeMount(() => {
// 接收客户端posemessage传递过来的消息
const obj = JSON.parse(localStorage.getItem("lowcode") || "");
console.log("数据哈哈哈", obj);
data.value = obj;
});
</script>
<style lang="scss" scoped>
.box {
width: 1000px;
height: 600px;
overflow: hidden;
}
</style>