You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vite-vue3-lowcode/src/App.vue

30 lines
703 B

4 years ago
<template>
<router-view #="{ Component, route }">
<component :is="Component" :key="route.path" />
</router-view>
4 years ago
</template>
<script lang="ts">
import { defineComponent, provide } from 'vue'
import { initVisualData, injectKey, localKey } from '@/visual-editor/hooks/useVisualData'
4 years ago
export default defineComponent({
name: 'App',
setup() {
const visualData = initVisualData()
// 注入可视化编辑器所有配置
provide(injectKey, visualData)
const { jsonData } = visualData
4 years ago
window.addEventListener('beforeunload', () => {
sessionStorage.setItem(localKey, JSON.stringify(jsonData))
4 years ago
})
}
})
</script>
<style lang="scss">
@import 'style/common';
</style>