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 2022/09/08 03:46:30 UTC

[GitHub] [echarts] echarts-bot[bot] commented on issue #17632: [Bug] getOption() 返回的类型不匹配

echarts-bot[bot] commented on issue #17632:
URL: https://github.com/apache/echarts/issues/17632#issuecomment-1240182326

   @zhl1232 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Bug] getOption() returns a type mismatch
   
   **BODY**
   
   ### Version
   
   e.g.5.3.2
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   1. Using TypeScript
   2. Calling instance.getOption() returns the type hint is ECBasicOption, but the actual return is something like {
       title: [{...}],
       legend: [{...}],
       grid: [{...}]
   }
   3. So using instance.getOption().legend[0] will prompt a type error
   Element implicitly has type 'any' because expressions of type '0' cannot be used for index type '{}'.
     Property '0' does not exist on type '{}'.
   
   ### Current Behavior
   
    instance.getOption() returns the wrong type
   
   ### Expected Behavior
   
    instance.getOption() return type and actual one to
   
   ### Environment
   
   ````markdown
   - OS:
   - Browser:
   - Framework:
   ````
   
   
   ### Any additional comments?
   
   _No response_
   </details>


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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