zend commented on issue #14974:
URL: https://github.com/apache/echarts/issues/14974#issuecomment-2134256116

   > > 应该跟之前一些开发者反馈的问题类似,先改用 `shallowRef` 试试看。
   > > ```ts
   > > const chart = shallowRef<any>()
   > > ```
   > 
   > hi, 如果chart是定义在data中的, 应该怎么赋初始类型?
   > 
   > ```
   > data() {
   >     return {
   >      // chart: shallowRef<any> 不能这样定义类型
   >       chart: null
   >     }
   >   },
   > methods: {
   > initChart() {
   >       this.chart = echarts.init(this.$el, 'macarons')
   >       ...
   >       }
   >      }
   > ```
   
   ```javascript
   import { shallowRef } from "vue";
   // ...
   data() {
       return {
         chart: shallowRef(),
       };
     },
   // ...
   ```


-- 
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-unsubscr...@echarts.apache.org

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


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

Reply via email to