forked from ElemeFE/v-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresize.vue
42 lines (41 loc) · 1.21 KB
/
resize.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
<!-- 测试属性
resizeable: { type: Boolean, default: true },
resizeDelay: { type: Number, default: 200 },
width: { type: String },
height: { type: String },
-->
<div>
<ve-line :data="chartData"></ve-line>
<ve-line :data="chartData" :cancel-resize-check="false"></ve-line>
<button @click="resizeable = !resizeable">
change resizeable: {{ resizeable }}
</button>
<ve-line :data="chartData" :resizeable="resizeable"></ve-line>
<button @click="change">change width height</button>
<ve-line :data="chartData" :width="chartWidth" :height="chartHeight"></ve-line>
<ve-line :data="chartData" :resizeable="false"></ve-line>
<ve-line :data="chartData" :resize-delay="1000"></ve-line>
</div>
</template>
<script>
import { VeLine } from '../../src/index.es'
import { LINE_DATA } from './data'
export default {
data () {
return {
chartData: LINE_DATA,
chartWidth: '400px',
chartHeight: '400px',
resizeable: true
}
},
methods: {
change () {
this.chartWidth = this.chartWidth === '400px' ? '300px' : '400px'
this.chartHeight = this.chartHeight === '400px' ? '300px' : '400px'
}
},
components: { VeLine }
}
</script>