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.
38 lines
853 B
38 lines
853 B
<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 sheep from '@/sheep';
|
|
const props = defineProps({
|
|
data: {
|
|
type: Object,
|
|
default: {},
|
|
},
|
|
styles: {
|
|
type: Object,
|
|
default() {},
|
|
},
|
|
});
|
|
const state = reactive({
|
|
content: '',
|
|
});
|
|
onMounted(async () => {
|
|
const { code, data } = await sheep.$api.data.richtext(props.data.id);
|
|
if (code === 1) {
|
|
state.content = data.content;
|
|
}
|
|
});
|
|
</script>
|
|
|