feat: TopBackBar에 slot 추가
This commit is contained in:
@@ -7,7 +7,10 @@
|
|||||||
<h2 class="title">
|
<h2 class="title">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</h2>
|
</h2>
|
||||||
<div v-if="teleportZone" :id="teleportZone" class="teleport-zone"></div>
|
<template v-if="hasSlot">
|
||||||
|
<slot></slot>
|
||||||
|
</template>
|
||||||
|
<div v-else-if="teleportZone" :id="teleportZone" class="teleport-zone"></div>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div> </div>
|
<div> </div>
|
||||||
<b-button
|
<b-button
|
||||||
@@ -25,7 +28,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import "@scss/game_bg.scss";
|
import "@scss/game_bg.scss";
|
||||||
import { type PropType, ref, watch } from "vue";
|
import { type PropType, ref, watch, useSlots } from "vue";
|
||||||
import VueTypes from "vue-types";
|
import VueTypes from "vue-types";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -52,6 +55,10 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const slots = useSlots();
|
||||||
|
console.log(slots);
|
||||||
|
const hasSlot = !!slots['default'];
|
||||||
|
|
||||||
const emit = defineEmits(["update:searchable", "reload"]);
|
const emit = defineEmits(["update:searchable", "reload"]);
|
||||||
|
|
||||||
const toggleSearch = ref(props.searchable);
|
const toggleSearch = ref(props.searchable);
|
||||||
|
|||||||
Reference in New Issue
Block a user