Authored by TaoHuang

add div to template

... ... @@ -36,6 +36,7 @@ export default {
}
},
render(h) {
console.log(this.template);
if (this.template) {
const parent = this.parent || this.$parent;
const {
... ...
... ... @@ -14,7 +14,7 @@
<div class="context-title">{{data.articleTitle}}</div>
<ClientOnly>
<div ref="richTextWrapper" @touchstart="tStart" @touchend="tEnd" class="context-rich-text">
<VRuntimeTemplate v-once ref="richText" :template="data.richText" :parent="{}"
<VRuntimeTemplate v-once ref="richText" :template="richText" :parent="{}"
:templateProps="{getNoteProduct}"></VRuntimeTemplate>
</div>
</ClientOnly>
... ... @@ -100,6 +100,9 @@ export default {
...mapState(['yoho']),
...mapArticleState(['articleStates', 'authorStates']),
...mapGetters(['getNoteProduct']),
richText() {
return `<div>${this.data.richText}</div>`;
},
articleState() {
const articleState = this.articleStates[this.data.articleId] || this.data;
const authorState = this.authorStates[`${this.data.authorUid}-${this.data.authorType}`] || this.data;
... ... @@ -215,7 +218,9 @@ export default {
},
found(richText) {
const vm = this;
const { childNodes = [] } = richText;
const { childNodes = [] } = richText.childNodes[0];
console.log(childNodes[0].nodeName);
// 特殊排版兼容
... ... @@ -329,6 +334,15 @@ export default {
font-size: 32px !important;
line-height: 1.8 !important;
/deep/ .product-item:first-child {
margin-left: 0;
}
.yhproduct {
margin-top: 20px !important;
margin-bottom: 20px !important;
}
.section-margin {
margin: 0 30px;
}
... ... @@ -459,8 +473,4 @@ export default {
.rec-article-title {
margin-top: -6px;
}
.yhproduct {
margin: 0 !important;
}
</style>
... ...