Skip to content

Commit 5d23006

Browse files
committed
chore: update demo
1 parent 443eaa0 commit 5d23006

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

src/demo/Demo.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ input {
297297
}
298298
299299
label {
300-
display: flex;
300+
display: inline-flex;
301301
align-items: center;
302302
justify-content: center;
303303
}
@@ -381,11 +381,13 @@ select {
381381
}
382382
}
383383
}
384+
}
384385
385-
.actions {
386-
display: flex;
387-
justify-content: center;
388-
}
386+
.actions {
387+
display: flex;
388+
justify-content: center;
389+
align-items: center;
390+
gap: 8px;
389391
}
390392
391393
.renderer,

src/demo/examples/PolarChart.vue

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
LegendComponent,
88
TooltipComponent
99
} from "echarts/components";
10-
import { shallowRef } from "vue";
10+
import { computed, shallowRef } from "vue";
1111
import VChart from "../../ECharts";
1212
import VExample from "./Example";
1313
import getData from "../data/polar";
@@ -22,15 +22,34 @@ use([
2222
2323
const option = shallowRef(getData());
2424
const theme = shallowRef("dark");
25+
const loading = shallowRef(false);
26+
const loadingOptions = computed(() =>
27+
theme.value === "dark"
28+
? {
29+
color: "#fff",
30+
textColor: "#fff",
31+
maskColor: "rgba(0, 0, 0, 0.7)"
32+
}
33+
: null
34+
);
35+
const style = computed(() => {
36+
return theme.value === "dark"
37+
? loading.value
38+
? "background-color: #05040d"
39+
: "background-color: #100c2a"
40+
: "";
41+
});
2542
</script>
2643

2744
<template>
2845
<v-example id="polar" title="Polar plot" desc="(with built-in theme)">
2946
<v-chart
3047
:option="option"
3148
autoresize
49+
:loading="loading"
50+
:loading-options="loadingOptions"
3251
:theme="theme"
33-
:style="theme === 'dark' ? 'background-color: #100c2a' : ''"
52+
:style="style"
3453
/>
3554
<template #extra>
3655
<p class="actions">
@@ -39,6 +58,10 @@ const theme = shallowRef("dark");
3958
<option :value="null">Default</option>
4059
<option value="dark">Dark</option>
4160
</select>
61+
<label>
62+
<input type="checkbox" v-model="loading" />
63+
Loading
64+
</label>
4265
</p>
4366
</template>
4467
</v-example>

0 commit comments

Comments
 (0)