Comments (5)
可以,你描述的情况应该是datav组件没有获取到正确的宽高 导致没显示出来 可以在控制台查看dom节点的渲染情况
from datav.
<dv-border-box-10><div id="myChart" :style="{width: '300px', height: '300px'}"></div></dv-border-box-10>,
检查元素时div有正常宽高,但是内容确显示不了
from datav.
如果要使用边框组件 建议将需要放置在边框内的内容单独封装成组件 这样比较容易避免这种情况出现
before
<dv-border-box-10>
<div ref="chart' class="chart"></div>
</dv-border-box-10>
after
<dv-border-box-10>
<component-a></component-a>
</dv-border-box-10>
<!--component-a-->
<template>
<div class="container">
<div ref="chart' class="chart"></div>
</div>
</template>
// style
.container, .chart {
width: 100%;
height: 100%
}
from datav.
有效度:楼上说得对,建议封装组件,我试过有效。
疑问:这是什么原理的,为什么封装成组件就能够很好的避免这种情况呢?
from datav.
echarts实例化时会获取dom宽高 当前页面mounted时 边框组件的slot插槽尚未渲染完毕 此时获取DOM宽高可能有误 封装成组件后 组件内的mounted函数被调用时 组件的父组件及祖先组件应当已经渲染完毕 此时可以避免获取宽高异常的情况 这只是我一种猜测
from datav.
Related Issues (20)
- resume is not a function
- dv-scroll-board updateRows()导致轮播抖动和变速
- vue3使用vue2版本时的报错怎么解决? HOT 1
- 请问是否支持修改动画速度 HOT 1
- 轮播表序号表头取消从“#”改为“编号” HOT 1
- autoResize.js:41 DataV: Component width or height is 0px, rendering abnormality may occur! HOT 1
- 轮播表可不可以监听滚动
- 轮播表的点击事件
- 官网没看到相关的ts类,目前写vue3+ts+vite项目,很多地方会报类型错误 HOT 2
- 用了全屏,加上dv-scroll-board 就下面会出白边
- 可以麻烦打一个新的release吗?当前release为2020年的。
- dv-scroll-board 组件设置列宽度不起作用 HOT 3
- vue2 main.js 引入后 编译报错
- dv-border-box-11中title不显示
- 颜色能修改么?
- 本地调试能显示,发布就不显示。 HOT 4
- 装饰12预览时报错:Duplicate keys detected error!
- 用了demo那个页面 都做成动态数据,页面卡、慢 HOT 1
- 怎么感觉很旧了,没维护? HOT 2
- 实测不兼容全屏容器不兼容手机,特别是横屏的情况根本没法用 ,各位想入坑同时让手机同样预览效果的掂量掂量,另外里面的装饰线也无法修改宽度 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datav.