Add exception prompt
This commit is contained in:
parent
1db9bd4b6b
commit
c8fb3596ee
|
@ -32,8 +32,14 @@ export default {
|
||||||
$nextTick(e => {
|
$nextTick(e => {
|
||||||
const dom = this.dom = $refs[ref]
|
const dom = this.dom = $refs[ref]
|
||||||
|
|
||||||
this.width = dom.clientWidth
|
this.width = dom ? dom.clientWidth : 0
|
||||||
this.height = dom.clientHeight
|
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()
|
if (typeof onResize === 'function' && resize) onResize()
|
||||||
|
|
||||||
|
@ -56,6 +62,8 @@ export default {
|
||||||
unbindDomResizeCallback () {
|
unbindDomResizeCallback () {
|
||||||
let { domObserver, debounceInitWHFun } = this
|
let { domObserver, debounceInitWHFun } = this
|
||||||
|
|
||||||
|
if (!domObserver) return
|
||||||
|
|
||||||
domObserver.disconnect()
|
domObserver.disconnect()
|
||||||
domObserver.takeRecords()
|
domObserver.takeRecords()
|
||||||
domObserver = null
|
domObserver = null
|
||||||
|
|
Loading…
Reference in New Issue