mirror of
https://github.com/robonen/tools.git
synced 2026-03-20 19:04:46 +00:00
feat: update package.json exports to support new module formats and types
This commit is contained in:
28
vue/primitives/src/presence/Presence.vue
Normal file
28
vue/primitives/src/presence/Presence.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<script lang="ts">
|
||||
export interface PresenceProps {
|
||||
present: boolean;
|
||||
forceMount?: boolean;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { usePresence } from './usePresence';
|
||||
|
||||
const {
|
||||
present,
|
||||
forceMount = false,
|
||||
} = defineProps<PresenceProps>();
|
||||
|
||||
defineSlots<{
|
||||
default?: (props: { present: boolean }) => any;
|
||||
}>();
|
||||
|
||||
const { isPresent, setRef } = usePresence(() => present);
|
||||
|
||||
defineExpose({ present: isPresent });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- @vue-expect-error ref is forwarded to slot -->
|
||||
<slot v-if="forceMount || present || isPresent" :ref="setRef" :present="isPresent" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user