-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get DOM width or height #525
Comments
It is ECharts' own behavior so I guess we don't have much to do about this. Maybe you can add a |
OK,thanks! |
I have the same problem in Nuxt3 every time that I change from page to page @Justineo do you have an example about this?
|
Is there an example ? |
Here you go: <template>
<v-chart v-if="showChart" :option="myOptions" autoresize />
</template>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import VChart from "vue-echarts";
const showChart = ref(false);
const myOptions = {
// ...
};
onMounted(() => (showChart.value = true));
</script>
|
@Justineo how is this supposed to help? The problem is that without specifically setting a width and an height to the |
@darkbasic If you think it’s a bug, please open a new issue with proper reproduction. Thanks. |
This worked for me |
The According to apache/echarts#10478 (comment), this works for me: <v-chart
:init-options="{ height: 'auto', width: 'auto' }"
:option="option"
/> |
The type of this issue / Issue 类型
Not introduced by ECharts / 非 ECharts 本身问题
Problems about ECharts itself are not handled in this repo. / 本 repo 不负责处理 ECharts 本身的问题。
Details / 详情
if wrap
vue-echart
with a div which hasv-show="false"
, will get an warning in console, saysCan't get DOM width or height
.Because wrapper div's display is none , and
x-vue-echarts
has no width and height, so echarts emit a warning.Vue version / Vue 版本
How are you importing Vue-ECharts? / 你是如何引入 Vue-ECharts 的?
vue-echarts
with a bundler environment / 在 webpack 等打包工具环境下引入vue-echarts
The version of Vue-ECharts you are using / Vue-ECharts 的版本
6.0.0-rc.3
Reproduction link / 复现链接
repro link
The text was updated successfully, but these errors were encountered: