<template>
  <FlexCol :padding="20">
    <Empty v-if="!content" image="search" description="空内容，请先编写内容后再预览" />
    <view v-else>
      <Parse :content="content" />
    </view>
  </FlexCol>
</template>

<script setup lang="ts">
import Parse from '@/components/display/parse/Parse.vue';
import Empty from '@/components/feedback/Empty.vue';
import FlexCol from '@/components/layout/FlexCol.vue';
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';

const content = ref();

onLoad(() => {
  uni.getStorage({
    key: 'editorContent',
    success: (success) => {
      content.value = success.data;
    },
  })
})
</script>