You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/06/02 11:57:06 UTC

[GitHub] [echarts] zhoufanglu opened a new issue #15074: hover、click事件多次触发finished的问题

zhoufanglu opened a new issue #15074:
URL: https://github.com/apache/echarts/issues/15074


   ### Version
   4.9.0
   
   ### Steps to reproduce
   我想在setOption()后触发finished,但是又不想在hover、click的时候触发finished事件
   
   ### What is expected?
   我想在setOption()后触发finished,但是又不想在hover、click的时候触发finished事件
   
   ### What is actually happening?
   在hover、click的时候触发了finished事件
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] zhoufanglu commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
zhoufanglu commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-853485193






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-853599042


   See https://github.com/apache/echarts/issues/10037#issuecomment-853596460


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] zhoufanglu commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
zhoufanglu commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-853485193


   最后还是暂时使用标记的方法解决了loading的问题,我感觉这样是治标不治本。有没有新的api
   ```js
       this.myChart.on('finished', () => {
         if (this.loading) {
           //如果还是加载状态,关闭Loading
           this.$emit('closeLoading')
         }
         if (!this.isFirstFinished) {
           //只有在第一次的时候resize
           this.isFirstFinished = true
           setTimeout(() => {
             this.myChart.resize()
           })
         }
       })
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-852965401






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Getchang commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
Getchang commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-853614979


   > > 放到一个promise里面
   > > `let prom = new Promise(resolve => { this.myChart.on('finished', function () { resolve() }) })`
   > > 然后
   > > `prom.then(() => { this.$emit('closeLoading') })`
   > 
   > > 放到一个promise里面
   > > `let prom = new Promise(resolve => { this.myChart.on('finished', function () { resolve() }) })`
   > > 然后
   > > `prom.then(() => { this.$emit('closeLoading') })`
   > 
   > 我之前试过了 没用
   
   > 这种做法是没有解决多次触发finished,但是可以让你的后续业务只触发一次,如果非要只触发一次finished,可以在业务操作执行后,解绑事件监听finished。
   `prom.then(() => { this.$emit('closeLoading'); this.myChart.off('finished')})`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] zhoufanglu commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
zhoufanglu commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-852965877


   标记判断是否为第一次finished不行。
   我需要的是 setOption一次, 触发一次finsihed方法,请问有什么方案吗?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Getchang commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
Getchang commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-853589875


   放到一个promise里面
   `
   let prom = new Promise(resolve => { 
          this.myChart.on('finished', function () {
                  resolve()
           })
   })
   `
   然后
   `prom.then(() => { this.$emit('closeLoading') })`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] zhoufanglu commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
zhoufanglu commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-853601021


   > 放到一个promise里面
   > `let prom = new Promise(resolve => { this.myChart.on('finished', function () { resolve() }) })`
   > 然后
   > `prom.then(() => { this.$emit('closeLoading') })`
   
   
   
   > 放到一个promise里面
   > `let prom = new Promise(resolve => { this.myChart.on('finished', function () { resolve() }) })`
   > 然后
   > `prom.then(() => { this.$emit('closeLoading') })`
   
   我之前试过了 没用


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-853599042


   See https://github.com/apache/echarts/issues/10037#issuecomment-853596460


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Getchang commented on issue #15074: hover、click事件多次触发finished的问题

Posted by GitBox <gi...@apache.org>.
Getchang commented on issue #15074:
URL: https://github.com/apache/echarts/issues/15074#issuecomment-853589875






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org