mirror of https://github.com/halo-dev/halo-admin
parent
a7f115f948
commit
360ddd13c6
@ -0,0 +1,16 @@
|
||||
<script lang="ts" setup>
|
||||
import { VTooltip } from "@/components/base/tooltip";
|
||||
import { VButton } from "@/components/base/button";
|
||||
</script>
|
||||
<template>
|
||||
<Story title="Tooltip">
|
||||
<template #default>
|
||||
<VTooltip content="Hello Halo">
|
||||
<VButton>Hello</VButton>
|
||||
</VTooltip>
|
||||
<VTooltip content="Hello Halo">
|
||||
<div class="inline-flex">Halo</div>
|
||||
</VTooltip>
|
||||
</template>
|
||||
</Story>
|
||||
</template>
|
@ -0,0 +1,25 @@
|
||||
<script lang="ts" setup>
|
||||
import tippy from "tippy.js";
|
||||
import "tippy.js/dist/tippy.css";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
content: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
tippy(".tooltip-wrapper > :first-child", {
|
||||
content: props.content,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<teleport to="body">
|
||||
<div class="tooltip-wrapper">
|
||||
<slot />
|
||||
</div>
|
||||
</teleport>
|
||||
</template>
|
@ -0,0 +1 @@
|
||||
export { default as VTooltip } from "./Tooltip.vue";
|
Loading…
Reference in new issue