chore: update deps and fix ts error

This commit is contained in:
Justineo
2024-04-22 12:30:41 +08:00
parent 34defec669
commit 54d196c9d5
3 changed files with 6107 additions and 5047 deletions

View File

@ -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;