提交 90b254e5 编写于 作者: Q qiang

fix(app): 修复图像加载导致原生组件显示错位的问题

上级 24e04ccf
......@@ -155,6 +155,7 @@ export default {
}
}
}
window.dispatchEvent(new CustomEvent('updateview'))
},
_resetSize () {
this.$el.style.width = this.originalStyle.width
......
<template>
<uni-rich-text v-on="$listeners">
<div />
<div ref="content">
<v-uni-resize-sensor
ref="sensor"
@resize="_updateView()"
/>
</div>
</uni-rich-text>
</template>
<script>
......@@ -27,14 +32,22 @@ export default {
},
methods: {
_renderNodes (nodes) {
if (typeof nodes === 'string') {
if (!this._isMounted) {
return
}
if (typeof nodes === 'string') {
nodes = parseHtml(nodes)
}
const nodeList = parseNodes(nodes, document.createDocumentFragment())
this.$el.firstChild.innerHTML = ''
this.$el.firstChild.appendChild(nodeList)
nodeList.appendChild(this.$refs.sensor.$el)
const content = this.$refs.content
content.innerHTML = ''
content.appendChild(nodeList)
},
_updateView () {
window.dispatchEvent(new CustomEvent('updateview'))
}
}
}
</script>
<style></style>
<style></style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册