<template>
  <u-empty v-if="!content" mode="news" text="空内容，请先编写内容后再预览" />
  <view v-else class="p-3">
    <u-parse :content="content" :tagStyle="commonParserStyle"></u-parse>
  </view>
</template>

<script setup lang="ts">
import commonParserStyle from '@/common/style/commonParserStyle';
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>