fix: 修复有些图表刷新按钮不生效的问题

This commit is contained in:
chenjinsong
2021-11-12 11:46:09 +08:00
parent 98846fd2da
commit 8375a4572b
3 changed files with 12 additions and 6 deletions

View File

@@ -352,11 +352,12 @@ noDataDom.setAttribute('class', 'no-data')
noDataDom.innerText = 'No data'
export const noData = {
updated (el, binding) {
console.info(binding)
if (el && binding.oldValue !== binding.value) {
if (binding.value) {
setTimeout(() => {
el.childNodes.forEach(node => {
node.style.display = 'none'
node.style && (node.style.display = 'none')
})
el.insertBefore(noDataDom, el.childNodes[0])
})
@@ -370,7 +371,7 @@ export const noData = {
}
}
el.childNodes.forEach(node => {
node.style.display = ''
node.style && (node.style.display = '')
})
})
}