Add exception prompt
This commit is contained in:
parent
1db9bd4b6b
commit
c8fb3596ee
|
@ -32,8 +32,14 @@ export default {
|
|||
$nextTick(e => {
|
||||
const dom = this.dom = $refs[ref]
|
||||
|
||||
this.width = dom.clientWidth
|
||||
this.height = dom.clientHeight
|
||||
this.width = dom ? dom.clientWidth : 0
|
||||
this.height = dom ? dom.clientHeight : 0
|
||||
|
||||
if (!dom) {
|
||||
console.warn('DataV: Failed to get dom node, component rendering may be abnormal!')
|
||||
} else if (!this.width || !this.height) {
|
||||
console.warn('DataV: Component width or height is 0px, rendering abnormality may occur!')
|
||||
}
|
||||
|
||||
if (typeof onResize === 'function' && resize) onResize()
|
||||
|
||||
|
@ -56,6 +62,8 @@ export default {
|
|||
unbindDomResizeCallback () {
|
||||
let { domObserver, debounceInitWHFun } = this
|
||||
|
||||
if (!domObserver) return
|
||||
|
||||
domObserver.disconnect()
|
||||
domObserver.takeRecords()
|
||||
domObserver = null
|
||||
|
|
Loading…
Reference in New Issue