generated from pascalmartineau/wp-skeleton
wip: UserSwitchButton
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
defineProps<{ userId: number }>();
|
||||
const { isUserSwitched, userSwitchBack, userSwitchTo } = useUserSwitching();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UButton v-if="isUserSwitched" variant="outline" @click="userSwitchBack()">
|
||||
Switch back
|
||||
</UButton>
|
||||
<UButton v-else @click="userSwitchTo(userId)">
|
||||
Switch to
|
||||
</UButton>
|
||||
</template>
|
||||
@@ -11,5 +11,6 @@ const showLabels = breakpoints.greaterOrEqual("sm");
|
||||
<UNavigationMenu :items="menuItems" variant="link" content-orientation="vertical" />
|
||||
<LoginLogoutButton :show-labels="showLabels" />
|
||||
<SignUpButton :show-labels="showLabels" />
|
||||
<UserSwitchButton :user-id="2" />
|
||||
</UContainer>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user