Commit 92e2c177 by 李嘉林

小程序换行

parent 77ca83be
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<!-- 富文本组件 --> <!-- 富文本组件 -->
<div <div
class="rich-text" 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> </div>
</template> </template>
...@@ -56,7 +56,6 @@ function formatRichText(html) { ...@@ -56,7 +56,6 @@ function formatRichText(html) {
return newContent; return newContent;
} }
export default { export default {
name: "rich-text",
props: { props: {
render: { render: {
type: Boolean, type: Boolean,
...@@ -64,7 +63,9 @@ export default { ...@@ -64,7 +63,9 @@ export default {
}, },
datas: { datas: {
type: Object, type: Object,
default: {}, default: ()=>{
return {}
},
}, },
}, },
data() { data() {
...@@ -73,13 +74,13 @@ export default { ...@@ -73,13 +74,13 @@ export default {
components: {}, components: {},
computed: { computed: {
padding() { padding() {
return this.datas.componentData["padding"]; return this.datas.componentData.padding;
}, },
backgroundColor() { backgroundColor() {
return this.datas.componentData["backgroundColor"]; return this.datas.componentData.backgroundColor;
}, },
richText() { richText() {
return formatRichText(this.datas.componentData["richText"]); return formatRichText(this.datas.componentData.richText);
}, },
}, },
created() {}, 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