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.
46 lines
736 B
46 lines
736 B
<template>
|
|
<view class="sh-richtext-box u-m-b-10" v-if="richText.content"><u-parse :html="richText.content"></u-parse></view>
|
|
</template>
|
|
|
|
<script>
|
|
/**
|
|
* 自定义之富文本卡片
|
|
* @property {Number|String} id - 富文本id
|
|
*/
|
|
export default {
|
|
components: {},
|
|
data() {
|
|
return {
|
|
richText: ''
|
|
};
|
|
},
|
|
computed: {},
|
|
props: {
|
|
richId: {
|
|
type: [Number, String],
|
|
default: 0
|
|
}
|
|
},
|
|
created() {
|
|
this.richId && this.getRichText();
|
|
},
|
|
methods: {
|
|
getRichText() {
|
|
this.$http('common.richText', {
|
|
id: this.richId
|
|
}).then(res => {
|
|
if (res.code === 1) {
|
|
this.richText = res.data;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.sh-richtext-box {
|
|
background: #fff;
|
|
padding: 30rpx;
|
|
}
|
|
</style>
|
|
|