Compare commits

..

17 Commits

Author SHA1 Message Date
b86280e1f0 fix: cleaned up the console.log call sneaked in by mistake 2023-02-08 16:32:30 +08:00
6159c7d684 fix: fix default behavior for notMerge, close #691 2023-02-08 16:22:51 +08:00
4313d301e4 docs: add codesandbox link 2023-02-03 14:55:08 +08:00
c13b482e12 chore: allow all hosts for devserver 2023-02-03 11:22:11 +08:00
b003b07222 docs: add codeflow link 2023-02-02 15:15:19 +08:00
89d15a9ee3 chore: remove esm deps 2023-02-02 00:45:29 +08:00
81272bfa0f chore: update stackblitz config, only build before publish 2023-02-02 00:40:24 +08:00
f554c89c58 chore: remove esm deps and unused files 2023-02-02 00:04:27 +08:00
5f7f9c0d4c feat: handle csp, extract css 2023-01-28 23:52:11 +08:00
f5819e4361 chore: update deps and version 2023-01-09 12:58:10 +08:00
16b9274ae1 fix: fix types for mouse events 2023-01-09 12:53:58 +08:00
cf963efc6d docs: sync chinese readme 2023-01-08 23:41:15 +08:00
fd36c5120b docs: @nuxtjs/composition-api is still needed for 2.7+ 2023-01-08 23:39:55 +08:00
4fab6c272b chore: make emit type a little more consistent with runtime 2023-01-08 23:38:03 +08:00
0edfb3936c types: use more precise typings for event handlers, update peer deps for echarts 2023-01-02 23:41:40 +08:00
ed4bd392ff chore: update readme version 2023-01-01 23:52:32 +08:00
58e7b13652 feat: improve typings for mouse events 2023-01-01 23:51:43 +08:00
16 changed files with 709 additions and 280 deletions

4
.stackblitzrc Normal file
View File

@ -0,0 +1,4 @@
{
"installDependencies": true,
"startCommand": "pnpm serve"
}

View File

@ -1,3 +1,28 @@
## 6.5.4
* Cleaned up the `console.log` call sneaked in by mistake.
## 6.5.3
* Fixed default behavior for `notMerge` option (#691).
## 6.5.2
* Added `dist/csp/*` to support strict CSP with extracted CSS file.
## 6.5.1
* Fixed types for mouse events.
## 6.5.0
* Use more precise typings for all event params.
* Updated peer deps for `echarts` to `^5.4.1`.
## 6.4.1
* Improve typings for mouse event params.
## 6.4.0 ## 6.4.0
* Delay the disposal of the ECharts instance to the moment the element is disconnected from the DOM if possible (#433). * Delay the disposal of the ECharts instance to the moment the element is disconnected from the DOM if possible (#433).

View File

@ -1,12 +1,12 @@
# Vue-ECharts <h1 align="center">Vue-ECharts</h1>
> Vue.js component for Apache ECharts. <p align="center">Vue.js <sup>(v2/v3)</sup> component for Apache ECharts <sup>(v5)</sup>.</p>
<p align="center"><a href="https://vue-echarts.dev/">View Demo →</a></p>
<p align="center"><a href="https:///pr.new/ecomfe/vue-echarts"><img alt="Open in Codeflow" src="https://developer.stackblitz.com/img/open_in_codeflow.svg" height="28"/></a><a href="https://codesandbox.io/p/github/ecomfe/vue-echarts"> <img alt="Edit in CodeSandbox" src="https://assets.codesandbox.io/github/button-edit-lime.svg" height="28"/></a></p>
> [🇨🇳 中文版](./README.zh-Hans.md) ---
Uses [Apache ECharts](https://echarts.apache.org/en/index.html) 5 and works for both [Vue.js](https://vuejs.org/) 2/3. <h2>💡 Heads up 💡 <a href="./README.zh-Hans.md"><img src="https://img.shields.io/badge/%F0%9F%87%A8%F0%9F%87%B3-%E4%B8%AD%E6%96%87%E7%89%88-white?labelColor=white" alt="前往中文版" align="right" height="24"/></a></h2>
## 💡 Heads up 💡
If you are migrating from `vue-echarts` ≤ 5, you should read the _[Migration to v6](#migration-to-v6)_ section before you update to v6. If you are migrating from `vue-echarts` ≤ 5, you should read the _[Migration to v6](#migration-to-v6)_ section before you update to v6.
@ -26,7 +26,7 @@ To make `vue-echarts` work for _Vue 2_ (<2.7.0), you need to have `@vue/composit
npm i -D @vue/composition-api npm i -D @vue/composition-api
``` ```
If you are using _NuxtJS_ on top of _Vue 2_ (<2.7.0), you'll also need `@nuxtjs/composition-api`: If you are using _NuxtJS_ on top of _Vue 2_, you'll also need `@nuxtjs/composition-api`:
```sh ```sh
npm i -D @nuxtjs/composition-api npm i -D @nuxtjs/composition-api
@ -225,9 +225,9 @@ Drop `<script>` inside your HTML file and access the component via `window.VueEC
<!-- vue3Scripts:start --> <!-- vue3Scripts:start -->
```html ```html
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.37"></script> <script src="https://cdn.jsdelivr.net/npm/vue@3.2.45"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script> <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.4.0"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.4"></script>
``` ```
<!-- vue3Scripts:end --> <!-- vue3Scripts:end -->
@ -245,9 +245,9 @@ app.component('v-chart', VueECharts)
<!-- vue2Scripts:start --> <!-- vue2Scripts:start -->
```html ```html
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.5"></script> <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script> <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.4.0"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.4"></script>
``` ```
<!-- vue2Scripts:end --> <!-- vue2Scripts:end -->
@ -453,6 +453,10 @@ Vue-ECharts support the following events:
See supported events [here →](https://echarts.apache.org/en/api.html#events) See supported events [here →](https://echarts.apache.org/en/api.html#events)
## CSP: `style-src` or `style-src-elem`
If you are applying a CSP to prevent inline `<style>` injection, you need to use files from `dist/csp` directory and include `dist/csp/style.css` into your app manually.
## Migration to v6 ## Migration to v6
> 💡 Please make sure to read the [migration guide](https://echarts.apache.org/en/tutorial.html#ECharts%205%20Upgrade%20Guide) for ECharts 5 as well. > 💡 Please make sure to read the [migration guide](https://echarts.apache.org/en/tutorial.html#ECharts%205%20Upgrade%20Guide) for ECharts 5 as well.

View File

@ -1,8 +1,10 @@
# Vue-ECharts <h1 align="center">Vue-ECharts</h1>
> Apache ECharts 的 Vue.js 组件。 <p align="center">Apache ECharts <sup>(v5)</sup> 的 Vue.js <sup>(v2/v3)</sup> 组件。</p>
<p align="center"><a href="https://vue-echarts.dev/">查看 Demo →</a></p>
<p align="center"><a href="https:///pr.new/ecomfe/vue-echarts"><img alt="Open in Codeflow" src="https://developer.stackblitz.com/img/open_in_codeflow.svg" height="28"/></a><a href="https://codesandbox.io/p/github/ecomfe/vue-echarts"> <img alt="Edit in CodeSandbox" src="https://assets.codesandbox.io/github/button-edit-lime.svg" height="28"/></a></p>
使用 [Apache ECharts](https://echarts.apache.org/zh/index.html) 5同时支持 [Vue.js](https://vuejs.org/) 2/3。 ---
## 💡 注意 💡 ## 💡 注意 💡
@ -24,7 +26,7 @@ $ npm install echarts vue-echarts
npm i -D @vue/composition-api npm i -D @vue/composition-api
``` ```
如果你在使用基于 _Vue 2_<2.7.0 _NuxtJS_那么还需要安装 `@nuxtjs/composition-api` 如果你在使用基于 _Vue 2_ _NuxtJS_那么还需要安装 `@nuxtjs/composition-api`
```sh ```sh
npm i -D @nuxtjs/composition-api npm i -D @nuxtjs/composition-api
@ -223,9 +225,9 @@ import "echarts";
<!-- vue3Scripts:start --> <!-- vue3Scripts:start -->
```html ```html
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.37"></script> <script src="https://cdn.jsdelivr.net/npm/vue@3.2.45"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script> <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.4.0"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.4"></script>
``` ```
<!-- vue3Scripts:end --> <!-- vue3Scripts:end -->
@ -243,9 +245,9 @@ app.component('v-chart', VueECharts)
<!-- vue2Scripts:start --> <!-- vue2Scripts:start -->
```html ```html
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.5"></script> <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3"></script> <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.4.0"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.4"></script>
``` ```
<!-- vue2Scripts:end --> <!-- vue2Scripts:end -->
@ -451,6 +453,10 @@ import { THEME_KEY } from 'vue-echarts'
静态方法请直接通过 [`echarts` 本身](https://echarts.apache.org/zh/api.html#echarts)进行调用。 静态方法请直接通过 [`echarts` 本身](https://echarts.apache.org/zh/api.html#echarts)进行调用。
## CSP: `style-src` 或 `style-src-elem`
如果你正在应用 CSP 来防止内联 `<style>` 注入,则需要使用 `dist/csp` 目录中的文件,并手动引入 `dist/csp/style.css`
## 迁移到 v6 ## 迁移到 v6
> 💡 请确保同时查阅 ECharts 5 的[升级指南](https://echarts.apache.org/zh/tutorial.html#ECharts%205%20%E5%8D%87%E7%BA%A7%E6%8C%87%E5%8D%97)。 > 💡 请确保同时查阅 ECharts 5 的[升级指南](https://echarts.apache.org/zh/tutorial.html#ECharts%205%20%E5%8D%87%E7%BA%A7%E6%8C%87%E5%8D%97)。

View File

@ -1,6 +1,6 @@
{ {
"name": "vue-echarts", "name": "vue-echarts",
"version": "6.4.0", "version": "6.5.4",
"description": "Vue.js component for Apache ECharts.", "description": "Vue.js component for Apache ECharts.",
"author": "GU Yiling <justice360@gmail.com>", "author": "GU Yiling <justice360@gmail.com>",
"scripts": { "scripts": {
@ -10,9 +10,9 @@
"build:3": "vue-demi-switch 3 && rollup -c rollup.config.js", "build:3": "vue-demi-switch 3 && rollup -c rollup.config.js",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"build:demo": "vue-cli-service build", "build:demo": "vue-cli-service build",
"docs": "node -r esm ./scripts/docs.js", "docs": "node ./scripts/docs.js",
"postinstall": "node ./scripts/postinstall.js", "postinstall": "node ./scripts/postinstall.js",
"prepare": "pnpm run build" "prepublishOnly": "pnpm run build"
}, },
"main": "dist/index.cjs.min.js", "main": "dist/index.cjs.min.js",
"module": "dist/index.esm.min.js", "module": "dist/index.esm.min.js",
@ -26,48 +26,47 @@
"vue-demi": "^0.13.2" "vue-demi": "^0.13.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.10", "@babel/core": "^7.18.6",
"@rollup/plugin-node-resolve": "^11.1.1", "@rollup/plugin-node-resolve": "^11.2.1",
"@typescript-eslint/eslint-plugin": "^4.15.1", "@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.15.1", "@typescript-eslint/parser": "^4.33.0",
"@vue/cli-plugin-babel": "^5.0.4", "@vue/cli-plugin-babel": "^5.0.7",
"@vue/cli-plugin-eslint": "^5.0.4", "@vue/cli-plugin-eslint": "^5.0.7",
"@vue/cli-plugin-typescript": "^5.0.4", "@vue/cli-plugin-typescript": "^5.0.7",
"@vue/cli-service": "^5.0.4", "@vue/cli-service": "^5.0.7",
"@vue/compiler-sfc": "^3.2.33", "@vue/compiler-sfc": "^3.2.37",
"@vue/composition-api": "^1.7.0", "@vue/composition-api": "^1.7.0",
"@vue/eslint-config-prettier": "^6.0.0", "@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^10.0.0", "@vue/eslint-config-typescript": "^10.0.0",
"comment-mark": "^1.0.0", "comment-mark": "^1.1.1",
"core-js": "^3.23.0", "core-js": "^3.23.3",
"echarts": "^5.3.2", "echarts": "^5.4.1",
"echarts-liquidfill": "^3.1.0", "echarts-liquidfill": "^3.1.0",
"eslint": "^7.20.0", "eslint": "^7.32.0",
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-vue": "^8.7.1", "eslint-plugin-vue": "^8.7.1",
"esm": "^3.2.25", "postcss": "^8.4.14",
"postcss": "^8.3.0", "postcss-loader": "^5.3.0",
"postcss-loader": "^5.0.0", "postcss-nested": "^5.0.6",
"postcss-nested": "^5.0.5", "prettier": "^2.7.1",
"prettier": "^2.6.2", "qs": "^6.11.0",
"qs": "^6.10.5",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"resize-detector": "^0.3.0", "resize-detector": "^0.3.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup": "^2.72.1", "rollup": "^2.75.7",
"rollup-plugin-dts": "^4.2.1", "rollup-plugin-dts": "^4.2.2",
"rollup-plugin-styles": "^4.0.0", "rollup-plugin-styles": "^4.0.0",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"rollup-plugin-ts": "^2.0.7", "rollup-plugin-ts": "^2.0.7",
"tslib": "^2.4.0", "tslib": "^2.4.0",
"typescript": "4.6.4", "typescript": "4.6.4",
"vue": "^3.2.33", "vue": "^3.2.37",
"vue2": "npm:vue@^2.7.14", "vue2": "npm:vue@^2.7.14",
"webpack": "^5.72.1" "webpack": "^5.73.0"
}, },
"peerDependencies": { "peerDependencies": {
"@vue/composition-api": "^1.0.5", "@vue/composition-api": "^1.0.5",
"echarts": "^5.1.2", "echarts": "^5.4.1",
"vue": "^2.6.12 || ^3.1.1" "vue": "^2.6.12 || ^3.1.1"
}, },
"jsdelivr": "dist/index.umd.min.js", "jsdelivr": "dist/index.umd.min.js",

591
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,34 @@ import resolve from "@rollup/plugin-node-resolve";
import styles from "rollup-plugin-styles"; import styles from "rollup-plugin-styles";
import { injectVueDemi } from "./scripts/rollup"; import { injectVueDemi } from "./scripts/rollup";
/**
* Convert Rollup option to a style extracted/injected version
* @param {import('rollup').RollupOptions} option
* @param {boolean} extract
* @returns {import('rollup').RollupOptions}
*/
function handleStyle(option, extract) {
// inject styles plugin
const result = { ...option };
const { plugins, output } = result;
result.plugins = (plugins || []).concat(
extract ? styles({ mode: ["extract", "style.css"] }) : styles()
);
// modify output file names
if (extract && output) {
result.output = (Array.isArray(output) ? output : [output]).map(output => {
return {
...output,
file: output.file.replace(/^dist\//, "dist/csp/"),
assetFileNames: "[name][extname]"
};
});
}
return result;
}
/** @type {import('rollup').RollupOptions[]} */ /** @type {import('rollup').RollupOptions[]} */
const options = [ const options = [
{ {
@ -15,8 +43,7 @@ const options = [
outputPath: (path, kind) => outputPath: (path, kind) =>
kind === "declaration" ? "dist/index.d.ts" : path kind === "declaration" ? "dist/index.d.ts" : path
} }
}), })
styles()
], ],
external: ["vue-demi", "echarts/core", "resize-detector"], external: ["vue-demi", "echarts/core", "resize-detector"],
output: { output: {
@ -27,7 +54,7 @@ const options = [
}, },
{ {
input: "src/index.ts", input: "src/index.ts",
plugins: [typescript(), styles()], plugins: [typescript()],
external: ["vue-demi", "echarts/core", "resize-detector"], external: ["vue-demi", "echarts/core", "resize-detector"],
output: [ output: [
{ {
@ -65,7 +92,7 @@ const options = [
}, },
{ {
input: "src/global.ts", input: "src/global.ts",
plugins: [resolve(), typescript(), styles()], plugins: [resolve(), typescript()],
external: ["vue-demi", "echarts", "echarts/core"], external: ["vue-demi", "echarts", "echarts/core"],
output: [ output: [
{ {
@ -105,4 +132,7 @@ const options = [
} }
]; ];
export default options; export default [
...options.map(option => handleStyle(option, false)),
...options.map(option => handleStyle(option, true))
];

View File

@ -1,16 +1,16 @@
import fs from "fs"; const fs = require("fs");
import { resolve } from "path"; const { resolve } = require("path");
import commentMark from "comment-mark"; const commentMark = require("comment-mark");
import { name, version } from "../package.json"; const { name, version } = require("../package.json");
const { readFile, writeFile } = fs.promises; const { readFile, writeFile } = fs.promises;
const CDN_PREFIX = "https://cdn.jsdelivr.net/npm/"; const CDN_PREFIX = "https://cdn.jsdelivr.net/npm/";
const DEP_VERSIONS = { const DEP_VERSIONS = {
"vue@3": "3.2.37", "vue@3": "3.2.45",
"vue@2": "2.7.5", "vue@2": "2.7.14",
echarts: "5.3.3", echarts: "5.4.1",
[name]: version [name]: version
}; };

View File

@ -1,6 +0,0 @@
{
"globals": {
"Vue": true,
"VueECharts": true
}
}

View File

@ -1,3 +0,0 @@
#app {
height: 400px;
}

View File

@ -1,3 +0,0 @@
<div id="app">
<v-chart autoresize :option="option"/>
</div>

View File

@ -1,55 +0,0 @@
Vue.component("v-chart", VueECharts);
new Vue({
el: "#app",
data() {
return {
option: {
textStyle: {
fontFamily: 'Inter, "Helvetica Neue", Arial, sans-serif'
},
title: {
text: "Traffic Sources",
left: "center"
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: "vertical",
left: "left",
data: [
"Direct",
"Email",
"Ad Networks",
"Video Ads",
"Search Engines"
]
},
series: [
{
name: "Traffic Sources",
type: "pie",
radius: "55%",
center: ["50%", "60%"],
data: [
{ value: 335, name: "Direct" },
{ value: 310, name: "Email" },
{ value: 234, name: "Ad Networks" },
{ value: 135, name: "Video Ads" },
{ value: 1548, name: "Search Engines" }
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
}
}
]
}
};
}
});

View File

@ -1,54 +0,0 @@
Vue.createApp({
data() {
return {
option: {
textStyle: {
fontFamily: 'Inter, "Helvetica Neue", Arial, sans-serif'
},
title: {
text: "Traffic Sources",
left: "center"
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: "vertical",
left: "left",
data: [
"Direct",
"Email",
"Ad Networks",
"Video Ads",
"Search Engines"
]
},
series: [
{
name: "Traffic Sources",
type: "pie",
radius: "55%",
center: ["50%", "60%"],
data: [
{ value: 335, name: "Direct" },
{ value: 310, name: "Email" },
{ value: 234, name: "Ad Networks" },
{ value: 135, name: "Video Ads" },
{ value: 1548, name: "Search Engines" }
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
}
}
]
}
};
}
})
.component("v-chart", VueECharts)
.mount("#app");

View File

@ -68,7 +68,7 @@ export default defineComponent({
...autoresizeProps, ...autoresizeProps,
...loadingProps ...loadingProps
}, },
emits: [] as unknown as Emits, emits: {} as unknown as Emits,
inheritAttrs: false, inheritAttrs: false,
setup(props, { attrs }) { setup(props, { attrs }) {
const root = shallowRef<EChartsElement>(); const root = shallowRef<EChartsElement>();
@ -233,7 +233,9 @@ export default defineComponent({
init(); init();
} else { } else {
chart.value.setOption(option, { chart.value.setOption(option, {
notMerge: option.value !== oldOption?.value, // mutating `option` will lead to `notMerge: false` and
// replacing it with new reference will lead to `notMerge: true`
notMerge: option !== oldOption,
...realUpdateOptions.value ...realUpdateOptions.value
}); });
} }

View File

@ -1,4 +1,9 @@
import { init, type SetOptionOpts } from "echarts/core"; import {
init,
type SetOptionOpts,
type ECElementEvent,
type ElementEvent
} from "echarts/core";
import type { Ref } from "vue"; import type { Ref } from "vue";
export type Injection<T> = T | null | Ref<T | null> | { value: T | null }; export type Injection<T> = T | null | Ref<T | null> | { value: T | null };
@ -20,16 +25,31 @@ export type EventTarget = EChartsType | ZRenderType;
type SetOptionType = EChartsType["setOption"]; type SetOptionType = EChartsType["setOption"];
export type Option = Parameters<SetOptionType>[0]; export type Option = Parameters<SetOptionType>[0];
type EChartsEventName = type MouseEventName =
| "click" | "click"
| "dblclick" | "dblclick"
| "mouseout"
| "mouseover"
| "mouseup"
| "mousedown" | "mousedown"
| "mousemove" | "mousemove"
| "mouseup"
| "mouseover"
| "mouseout"
| "globalout"
| "contextmenu" | "contextmenu"
| "globalout";
type ElementEventName =
| MouseEventName
| "mousewheel"
| "drag"
| "dragstart"
| "dragend"
| "dragenter"
| "dragleave"
| "dragover"
| "drop";
type ZRenderEventName = `zr:${ElementEventName}`;
type OtherEventName =
| "highlight" | "highlight"
| "downplay" | "downplay"
| "selectchanged" | "selectchanged"
@ -56,28 +76,22 @@ type EChartsEventName =
| "brush" | "brush"
| "brushEnd" | "brushEnd"
| "brushselected" | "brushselected"
| "globalcursortaken" | "globalcursortaken";
| "rendered"
| "finished"; type MouseEmits = {
type ZRenderEventName = [key in MouseEventName]: (params: ECElementEvent) => boolean;
| "click"
| "dblclick"
| "mousewheel"
| "mouseout"
| "mouseover"
| "mouseup"
| "mousedown"
| "mousemove"
| "contextmenu"
| "drag"
| "dragstart"
| "dragend"
| "dragenter"
| "dragleave"
| "dragover"
| "drop"
| "globalout";
type EventName = EChartsEventName | `zr:${ZRenderEventName}`;
export type Emits = {
[key in EventName]: null;
}; };
type ZRenderEmits = {
[key in ZRenderEventName]: (params: ElementEvent) => boolean;
};
type OtherEmits = {
[key in OtherEventName]: null;
};
export type Emits = MouseEmits &
OtherEmits & {
rendered: (params: { elapsedTime: number }) => boolean;
finished: () => boolean;
} & ZRenderEmits;

View File

@ -21,5 +21,8 @@ module.exports = {
.test(/\.svg$/) .test(/\.svg$/)
.use("raw-loader") .use("raw-loader")
.loader("raw-loader"); .loader("raw-loader");
},
devServer: {
allowedHosts: "all"
} }
}; };