...
|
...
|
@@ -188,11 +188,27 @@ export default { |
|
|
|
|
|
this.$nextTick(() => {
|
|
|
if (this.$refs.richText) {
|
|
|
(this.$refs.richText.childNodes || []).forEach(ele => {
|
|
|
if (ele.querySelector('img')) {
|
|
|
ele.style.margin = 0;
|
|
|
}
|
|
|
});
|
|
|
const {childNodes = []} = this.$refs.richText;
|
|
|
|
|
|
// 特殊排版兼容
|
|
|
|
|
|
if (childNodes.length === 1 && childNodes[0].nodeName === 'SECTION') {
|
|
|
const $parentSectionNode = childNodes[0];
|
|
|
|
|
|
$parentSectionNode.style.margin = 0;
|
|
|
($parentSectionNode.childNodes || []).forEach(ele => {
|
|
|
if (!ele.querySelector('img')) {
|
|
|
ele.classList.add('section-margin');
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
childNodes.forEach(ele => {
|
|
|
if (ele.querySelector('img')) {
|
|
|
ele.style.margin = 0;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
this.$refs.richText.querySelectorAll('a').forEach(ele => {
|
|
|
if (ele.querySelector('img')) {
|
|
|
ele.classList.add('yoho-img-link');
|
...
|
...
|
@@ -280,6 +296,10 @@ export default { |
|
|
font-size: 32px !important;
|
|
|
line-height: 1.8 !important;
|
|
|
|
|
|
.section-margin {
|
|
|
margin: 0 30px;
|
|
|
}
|
|
|
|
|
|
* {
|
|
|
font-family: "PingFang SC", "HiraginoSansGB-W3", "SanFranciscoText-Regular", Helvetica, Roboto, "Heiti SC", "黑体", Arial, sans-serif !important;
|
|
|
}
|
...
|
...
|
|