dykj-uniapp-store/sheep/components/s-richtext-block/s-richtext-block.vue
2024-05-24 09:16:17 +08:00

41 lines
881 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 装修营销组件营销文章 -->
<template>
<view
:style="[
{
marginLeft: styles.marginLeft + 'px',
marginRight: styles.marginRight + 'px',
marginBottom: styles.marginBottom + 'px',
marginTop: styles.marginTop + 'px',
padding: styles.padding + 'px',
},
]"
>
<mp-html class="richtext" :content="state.content"></mp-html>
</view>
</template>
<script setup>
import { reactive, onMounted } from 'vue';
import ArticleApi from '@/api/promotion/article';
const props = defineProps({
data: {
type: Object,
default: {},
},
styles: {
type: Object,
default() {},
},
});
const state = reactive({
content: '',
});
onMounted(async () => {
const { data } = await ArticleApi.getArticle(props.data.id);
state.content = data.content;
});
</script>