mirror of
https://gitee.com/was666/as-editor.git
synced 2026-04-21 00:00:01 +08:00
43 lines
688 B
Vue
43 lines
688 B
Vue
<template>
|
|
<div class="richtext" :style="{ background: datas.backColor }">
|
|
<img
|
|
draggable="false"
|
|
src="../../../assets/images/fwb.png"
|
|
alt=""
|
|
v-if="!datas.myValue.length"
|
|
/>
|
|
<section v-else v-html="datas.myValue" />
|
|
|
|
<!-- 删除组件 -->
|
|
<slot name="deles" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'richtext',
|
|
props: {
|
|
datas: Object,
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.richtext {
|
|
position: relative;
|
|
}
|
|
:deep(img) {
|
|
max-width: 100% !important;
|
|
display: block;
|
|
}
|
|
.richtext {
|
|
position: relative;
|
|
:deep(pre) {
|
|
white-space: break-spaces;
|
|
}
|
|
:deep(p) {
|
|
word-break: break-all;
|
|
}
|
|
}
|
|
</style>
|