mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-11-05 20:36:09 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d774558f3e | |||
| 5d23006866 | |||
| 443eaa0367 |
@ -238,7 +238,7 @@ Drop `<script>` inside your HTML file and access the component via `window.VueEC
|
|||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.23"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.23"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.2"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
|
||||||
```
|
```
|
||||||
<!-- vue3Scripts:end -->
|
<!-- vue3Scripts:end -->
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ app.component('v-chart', VueECharts)
|
|||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.2"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
|
||||||
```
|
```
|
||||||
<!-- vue2Scripts:end -->
|
<!-- vue2Scripts:end -->
|
||||||
|
|
||||||
|
|||||||
@ -238,7 +238,7 @@ import "echarts";
|
|||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.23"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.23"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.2"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
|
||||||
```
|
```
|
||||||
<!-- vue3Scripts:end -->
|
<!-- vue3Scripts:end -->
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ app.component('v-chart', VueECharts)
|
|||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.2"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
|
||||||
```
|
```
|
||||||
<!-- vue2Scripts:end -->
|
<!-- vue2Scripts:end -->
|
||||||
|
|
||||||
|
|||||||
@ -297,7 +297,7 @@ input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
label {
|
label {
|
||||||
display: flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
@ -311,7 +311,7 @@ select {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#logo {
|
#logo {
|
||||||
display: inline-block;
|
display: inline-flex;
|
||||||
width: 128px;
|
width: 128px;
|
||||||
height: 128px;
|
height: 128px;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@ -381,11 +381,13 @@ select {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.actions {
|
.actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.renderer,
|
.renderer,
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
LegendComponent,
|
LegendComponent,
|
||||||
TooltipComponent
|
TooltipComponent
|
||||||
} from "echarts/components";
|
} from "echarts/components";
|
||||||
import { shallowRef } from "vue";
|
import { computed, shallowRef } from "vue";
|
||||||
import VChart from "../../ECharts";
|
import VChart from "../../ECharts";
|
||||||
import VExample from "./Example";
|
import VExample from "./Example";
|
||||||
import getData from "../data/polar";
|
import getData from "../data/polar";
|
||||||
@ -22,6 +22,23 @@ use([
|
|||||||
|
|
||||||
const option = shallowRef(getData());
|
const option = shallowRef(getData());
|
||||||
const theme = shallowRef("dark");
|
const theme = shallowRef("dark");
|
||||||
|
const loading = shallowRef(false);
|
||||||
|
const loadingOptions = computed(() =>
|
||||||
|
theme.value === "dark"
|
||||||
|
? {
|
||||||
|
color: "#fff",
|
||||||
|
textColor: "#fff",
|
||||||
|
maskColor: "rgba(0, 0, 0, 0.7)"
|
||||||
|
}
|
||||||
|
: null
|
||||||
|
);
|
||||||
|
const style = computed(() => {
|
||||||
|
return theme.value === "dark"
|
||||||
|
? loading.value
|
||||||
|
? "background-color: #05040d"
|
||||||
|
: "background-color: #100c2a"
|
||||||
|
: "";
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -29,8 +46,10 @@ const theme = shallowRef("dark");
|
|||||||
<v-chart
|
<v-chart
|
||||||
:option="option"
|
:option="option"
|
||||||
autoresize
|
autoresize
|
||||||
|
:loading="loading"
|
||||||
|
:loading-options="loadingOptions"
|
||||||
:theme="theme"
|
:theme="theme"
|
||||||
:style="theme === 'dark' ? 'background-color: #100c2a' : ''"
|
:style="style"
|
||||||
/>
|
/>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<p class="actions">
|
<p class="actions">
|
||||||
@ -39,6 +58,10 @@ const theme = shallowRef("dark");
|
|||||||
<option :value="null">Default</option>
|
<option :value="null">Default</option>
|
||||||
<option value="dark">Dark</option>
|
<option value="dark">Dark</option>
|
||||||
</select>
|
</select>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" v-model="loading" />
|
||||||
|
Loading
|
||||||
|
</label>
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
</v-example>
|
</v-example>
|
||||||
|
|||||||
Reference in New Issue
Block a user