feat: TopBackBar에 slot 추가

This commit is contained in:
2022-05-16 23:20:11 +09:00
parent 2b6ff06c01
commit 5828a4fefb
+9 -2
View File
@@ -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>&nbsp;</div> <div>&nbsp;</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);