Commit 92e2c177 by 李嘉林

小程序换行

parent 77ca83be
......@@ -2,9 +2,9 @@
<!-- 富文本组件 -->
<div
class="rich-text"
:style="{ padding: padding + 'px', background: backgroundColor }"
:style="{ 'padding': padding + 'px', 'background': backgroundColor }"
>
<div v-html="richText"></div>
<rich-text :nodes="richText" :space="'nbsp'"></rich-text>
</div>
</template>
......@@ -56,7 +56,6 @@ function formatRichText(html) {
return newContent;
}
export default {
name: "rich-text",
props: {
render: {
type: Boolean,
......@@ -64,7 +63,9 @@ export default {
},
datas: {
type: Object,
default: {},
default: ()=>{
return {}
},
},
},
data() {
......@@ -73,13 +74,13 @@ export default {
components: {},
computed: {
padding() {
return this.datas.componentData["padding"];
return this.datas.componentData.padding;
},
backgroundColor() {
return this.datas.componentData["backgroundColor"];
return this.datas.componentData.backgroundColor;
},
richText() {
return formatRichText(this.datas.componentData["richText"]);
return formatRichText(this.datas.componentData.richText);
},
},
created() {},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment