1***@qq.com
1***@qq.com
  • 发布:2023-01-12 18:13
  • 更新:2023-01-13 15:28
  • 阅读:374

【报Bug】echarts 使用renderjs,在renderjs里有时获取不到option,报错

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: other

HBuilderX类型: 正式

HBuilderX版本号: 3.6.10

手机系统: 全部

手机厂商: 华为

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

测试过的手机:

所有

示例代码:
<div class="echarts"  
            :id="option.id" ref='echarts1'  
            @click="echarts.onClick"  
                        :options="options"  
            :change:options="echarts.update"  
        ></div>
<script module="echarts" lang="renderjs">  
mounted() {  
            if (this.options) {  
                if (typeof window.echarts === 'object') {  
                    this.init()  
                } else {  
                    // 动态引入类库  
                    const script = document.createElement('script')  
                    // #ifdef H5  
                    script.src = '/static/echarts.js'  
                    // #endif  
                    // #ifndef H5  
                    script.src = 'static/echarts.js'  
                    // #endif  
                    script.onload = this.init.bind(this)  
                    document.head.appendChild(script)  
                }  
}  
}  
init() {  
                // this.chart = echarts.init(this.$el)  
                // 经测试,使用this.$el初始化组件时,点击事件不能触发,需设置id。这样的话,同一页面多个组件使用同一个option会导致只能显示一个  
                // 根据id初始化图表  
                this.chart = echarts.init(this.$refs.echarts1)  
                this.update(this.options)  
}  

操作步骤:

网好的时候没问题,网不好时就出现这个问题

预期结果:

网不好也展示echarts

实际结果:

网不好不展示echarts

bug描述:

18:01:33.272 RangeError: Maximum call stack size exceeded
18:01:33.284 TvpeError: Cannot set propertv '2' of undefined
18:01:35.148 cid unmatched fobiect Obiect1 at view.umd.min.is:1
18:01:35.159 TvpeError: Invalid attempt to destructure non-iterable instance
In order to be iterable, non-array obiects must have a[Symbol.iterator1() method. at view.umd.min.is:118:01:35.160 cid unmatched fobiect Obiect1 at view.umd.min.is:1
18:01:35.160 TypeError: Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a[Symbol.iterator]() method. at view.umd.min.js:118:05:24.804

打印的option是undefined

2023-01-12 18:13 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com (作者)

15:27:56.616 RangeError: Maximum call stack size exceeded
15:27:56.627 TypeError: Cannot set property '1' of undefined
15:28:00.234 cid unmatched [object Object] at view.umd.min.js:1
15:28:00.249 TypeError: Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method. at view.umd.min.js:1
15:28:00.281 cid unmatched [object Object] at view.umd.min.js:1
15:28:00.294 TypeError: Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method. at view.umd.min.js:1

要回复问题请先登录注册