Giter VIP home page Giter VIP logo

Comments (4)

Ovilia avatar Ovilia commented on May 4, 2024

为什么想直接传 options?有什么好处?这样会限制原有 echarts 的其他接口

from echarts-for-weixin.

anchengjian avatar anchengjian commented on May 4, 2024

感谢回复。

原来还有其他接口,我当时只看到有 lazyLoad 和 onInit 这两个接口配置。

初衷是不想用太繁琐的初始化方法,直接传一个 options 给组件渲染完就好。然后在某些情况下,通过 data 传 function 会有困难,也违背 data 的语义,感觉不优雅,大致就这样。

from echarts-for-weixin.

Ovilia avatar Ovilia commented on May 4, 2024

如果你有特殊需求可以照这个思路自己再封装一次,但通用的还是需要兼容一般的 echarts 初始化的做法

from echarts-for-weixin.

yfzhangCode avatar yfzhangCode commented on May 4, 2024

@anchengjian 您好,我在mpvue中使用的是您推荐的 那种方法。。由于图表较多,我在utils中把options 封装了一下,每个页面进行获取,然后赋值给ec.options,但是数据改变后,我如果在mounted中初始化 echart, 数据图表是空白(没有绘制)。。在created中初始化是可以显示的。。。疑问是:为什么在mounted()中进行数据的初始化后没有绘制图表?

from echarts-for-weixin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.