内容描述

echarts相关组件,配置tool tips 后,出现tips 提示在屏幕外;
image.png

代码内容

  1. function() {
  2. return {
  3. //组件初始化
  4. "init": function (options) {
  5. this._super.apply(this, arguments);
  6. },
  7. //容器内所有组件加载完成
  8. "allChildrenLoaded": function () {
  9. },
  10. dataSource: function(opt){
  11. if(opt instanceof Array) {
  12. opt.tooltip.forEach(item => {
  13. item.confine = true;
  14. })
  15. }else {
  16. opt.tooltip.confine = true;
  17. }
  18. }
  19. };
  20. }

使用说明

在echarts 对应的组件中,注入上述代码