57 lines
1.2 KiB
Vue
Raw Permalink Normal View History

2025-05-08 16:52:29 +08:00
<!-- 装修营销组件富文本 -->
<template>
<view
:style="[
{
marginLeft: styles.marginLeft + 'px',
marginRight: styles.marginRight + 'px',
marginBottom: styles.marginBottom + 'px',
marginTop: styles.marginTop + 'px',
padding: '12px',
width:'100%',
minHeight:'100px',
boxSizing:'border-box'
},
]"
>
<!-- <rich-text :nodes="state.content"></rich-text> -->
<rich-text :nodes="props.data.richText"></rich-text>
<!-- </rich-text>
<!-- <mp-html class="richtext" :content="state.content"></mp-html> -->
</view>
</template>
<script setup>
import { reactive, onMounted } from 'vue';
import ArticleApi from '@/sheep/api/promotion/article';
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
const props = defineProps({
data: {
type: Object,
default: {},
},
styles: {
type: Object,
default() {},
},
});
const state = reactive({
content: '',
});
onLoad((options)=>{
console.log("传进富文本来的数据",props)
})
onShow(()=>{
state.content = props.data.richText
})
// onMounted(async () => {
// const { data } = await ArticleApi.getArticle(props.data.id);
// state.content = data.content;
// });
</script>