Skip to content

Commit 85f52a3

Browse files
authored
fix: resolve the error caused by VueUse removing isString (#359)
1 parent 37cff0f commit 85f52a3

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

packages/vue-final-modal/src/components/ModalsContainer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { computed, onBeforeUnmount } from 'vue'
3-
import { isString } from '@vueuse/core'
3+
import { isString } from '~/utils'
44
import { useInternalVfm, useVfm } from '~/useApi'
55
66
const vfm = useVfm()

packages/vue-final-modal/src/useApi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { computed, inject, markRaw, nextTick, reactive, useAttrs } from 'vue'
2-
import { isString, tryOnUnmounted } from '@vueuse/core'
2+
import { tryOnUnmounted } from '@vueuse/core'
33
import type { Component } from 'vue'
44
import VueFinalModal from './components/VueFinalModal/VueFinalModal.vue'
55
import type CoreModal from './components/CoreModal/CoreModal.vue'
66
import { internalVfmSymbol } from './injectionSymbols'
77

88
import type { ComponentProps, Constructor, InternalVfm, ModalSlot, ModalSlotOptions, RawProps, UseModalOptions, UseModalOptionsPrivate, UseModalReturnType, Vfm } from './Modal'
99
import { activeVfm, getActiveVfm } from './plugin'
10+
import { isString } from '~/utils'
1011

1112
/**
1213
* Returns the vfm instance. Equivalent to using `$vfm` inside

packages/vue-final-modal/src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ export const noop = () => {}
1212
export function clamp(val: number, min: number, max: number) {
1313
return val > max ? max : val < min ? min : val
1414
}
15+
16+
export const isString = (value: unknown): value is string => typeof value === 'string'

0 commit comments

Comments
 (0)