mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-15 20:26:52 +08:00
chore: update deps and fix ts error
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { unref } from "vue-demi";
|
||||
import { unref, isRef } from "vue-demi";
|
||||
import type { Injection } from "./types";
|
||||
|
||||
type Attrs = {
|
||||
@ -26,7 +26,7 @@ export function unwrapInjected<T, V>(
|
||||
injection: Injection<T>,
|
||||
defaultValue: V
|
||||
): T | V {
|
||||
const value = unref(injection);
|
||||
const value = isRef(injection) ? unref(injection) : injection;
|
||||
|
||||
if (value && typeof value === "object" && "value" in value) {
|
||||
return value.value || defaultValue;
|
||||
|
Reference in New Issue
Block a user