feat: manage to get the popup to render with correct positions
This commit is contained in:
parent
fe77b2c28d
commit
9d69dac77a
2 changed files with 42 additions and 23 deletions
|
@ -1,29 +1,25 @@
|
|||
<template>
|
||||
<div class="member-item" @click.prevent="createProfileModal(props.member)" tabindex="0">
|
||||
<div class="member-item" @click.prevent="toggleModalPopup" tabindex="0">
|
||||
<Avatar :profile="props.member" class="member-avatar"/>
|
||||
<span class="member-display-name">{{ getDisplayName(props.member) }}</span>
|
||||
</div>
|
||||
<ModalProfilePopup v-if="modalPopupVisible"
|
||||
:profile="props.member"/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ModalProfilePopup } from '#components';
|
||||
import { render } from 'vue';
|
||||
import type { GuildMemberResponse } from '~/types/interfaces';
|
||||
|
||||
const props = defineProps<{
|
||||
member: GuildMemberResponse
|
||||
}>();
|
||||
|
||||
function createProfileModal(profile: GuildMemberResponse) {
|
||||
const div = document.createElement("div");
|
||||
const modal = h(ModalProfilePopup, {
|
||||
profile: profile
|
||||
});
|
||||
|
||||
document.body.appendChild(div);
|
||||
render(modal, div);
|
||||
}
|
||||
const modalPopupVisible = ref<boolean>(false);
|
||||
|
||||
function toggleModalPopup() {
|
||||
modalPopupVisible.value = !modalPopupVisible.value
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue