mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-15 20:26:52 +08:00
feat!: remove vue 2
This commit is contained in:
17
src/utils.ts
17
src/utils.ts
@ -1,7 +1,3 @@
|
||||
import { unref, isRef } from "vue-demi";
|
||||
|
||||
import type { Injection } from "./types";
|
||||
|
||||
type Attrs = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any;
|
||||
@ -22,16 +18,3 @@ export function omitOn(attrs: Attrs): Attrs {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export function unwrapInjected<T, V>(
|
||||
injection: Injection<T>,
|
||||
defaultValue: V
|
||||
): T | V {
|
||||
const value = isRef(injection) ? unref(injection) : injection;
|
||||
|
||||
if (value && typeof value === "object" && "value" in value) {
|
||||
return value.value || defaultValue;
|
||||
}
|
||||
|
||||
return value || defaultValue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user