feat: use v-if instead of programmatically rendering invite modal in GuildOptionsMenu
This commit is contained in:
parent
088c6c558b
commit
480c91d419
1 changed files with 5 additions and 8 deletions
|
@ -4,23 +4,20 @@
|
||||||
<button class="guild-option-button" @click="setting.action" tabindex="0">{{ setting.name }}</button>
|
<button class="guild-option-button" @click="setting.action" tabindex="0">{{ setting.name }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ModalInvite v-if="showInviteModal" :guild-id="guildId" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { render } from 'vue';
|
|
||||||
import InviteModal from '../Modals/InviteModal.vue';
|
|
||||||
|
|
||||||
const settings = [
|
const settings = [
|
||||||
{ name: "Invite", icon: "lucide:letter", action: openInviteModal }
|
{ name: "Invite", icon: "lucide:letter", action: openInviteModal }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const guildId = useRoute().params.serverId as string;
|
||||||
|
const showInviteModal = ref(false);
|
||||||
|
|
||||||
function openInviteModal() {
|
function openInviteModal() {
|
||||||
const div = document.createElement("div");
|
showInviteModal.value = true;
|
||||||
const guildId = useRoute().params.serverId as string;
|
|
||||||
console.log("guild id:", guildId);
|
|
||||||
const inviteModal = h(InviteModal, { guildId });
|
|
||||||
document.body.appendChild(div);
|
|
||||||
render(inviteModal, div);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue