为了账号安全,请及时绑定邮箱和手机立即绑定

无法正确获取DOM元素

无法正确获取DOM元素

xiaomizhou66 2018-09-29 16:14:24
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);                }            }        },
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1592 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信