fix: adaptive width problem during chart component initialization;🐛

修复:图表组件初始化时自适应宽度问题;
This commit is contained in:
iczer
2020-06-26 15:43:39 +08:00
parent f90b6e8731
commit b9cdfdc476
4 changed files with 30 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
<template>
<a-card :body-style="{padding: '20px 24px 8px'}" :bordered="false">
<a-card :loading="loading" :body-style="{padding: '20px 24px 8px'}" :bordered="false">
<div class="chart-card-header">
<div class="meta">
<span class="chart-card-title">{{title}}</span>
@@ -23,7 +23,7 @@
<script>
export default {
name: 'ChartCard',
props: ['title', 'total']
props: ['title', 'total', 'loading']
}
</script>

View File

@@ -1,11 +1,13 @@
<template>
<div >
<div class="bar">
<h4>{{title}}</h4>
<v-chart :force-fit="true" height="251" :data="data">
<v-tooltip />
<v-axis />
<v-bar position="x*y"/>
</v-chart>
<div class="chart">
<v-chart :force-fit="true" height="312" :data="data" :padding="[24, 0, 0, 0]">
<v-tooltip />
<v-axis />
<v-bar position="x*y"/>
</v-chart>
</div>
</div>
</template>
@@ -48,6 +50,10 @@ export default {
}
</script>
<style scoped>
<style scoped lang="less">
.bar{
position: relative;
.chart{
}
}
</style>