iview.js?7687:24282 Uncaught TypeError: Cannot read property 'offsetWidth' of undefined
at VueComponent.updateNavScroll (iview.js?7687:24282)
at VueComponent.handleResize (iview.js?7687:24298)
at callListenerProxy (iview.js?7687:23611)
at utils.forEach (iview.js?7687:23800)
at onResizeCallback (iview.js?7687:23610)
at listenerProxy (iview.js?7687:38526)
at VueComponent.updateNavScroll (iview.js?7687:24282)
at VueComponent.handleResize (iview.js?7687:24298)
at addListener (iview.js?7687:23619)
at onElementDetectable (iview.js?7687:23694)
在使用iview表单的时候出现了这个错误
updateNavScroll: function updateNavScroll() {
var navWidth = this.$refs.nav.offsetWidth;
var containerWidth = this.$refs.navScroll.offsetWidth;
var currentOffset = this.getCurrentScrollOffset();
if (containerWidth < navWidth) {
this.scrollable = true;
if (navWidth - currentOffset < containerWidth) {
this.setOffset(navWidth - containerWidth);
}
} else {
this.scrollable = false;
if (currentOffset > 0) {
this.setOffset(0);
}
}
},