-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(AppDrawerAppend): add rail toggle for subscribers
- Loading branch information
1 parent
df2a373
commit f710ccf
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
<template> | ||
<v-divider /> | ||
|
||
<git-hub-login /> | ||
<v-hover> | ||
<template #default="{ props: hoverProps, isHovering }"> | ||
<div v-bind="hoverProps"> | ||
<v-expand-transition v-if="auth.isSubscriber"> | ||
<drawer-toggle-rail v-if="isHovering" /> | ||
</v-expand-transition> | ||
|
||
<git-hub-login /> | ||
</div> | ||
</template> | ||
</v-hover> | ||
</template> | ||
|
||
<script setup> | ||
// Components | ||
import DrawerToggleRail from '@/components/app/drawer/DrawerToggleRail.vue' | ||
import GitHubLogin from '@/components/app/GitHubLogin.vue' | ||
// Stores | ||
import { useAuthStore } from '@/store/auth' | ||
const auth = useAuthStore() | ||
</script> |
26 changes: 26 additions & 0 deletions
26
packages/docs/src/components/app/drawer/DrawerToggleRail.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<template> | ||
<div> | ||
<v-list-item | ||
:prepend-icon="icon" | ||
@click="onClick" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
// Stores | ||
import { useUserStore } from '@/store/user' | ||
// Utilities | ||
import { computed } from 'vue' | ||
const user = useUserStore() | ||
const icon = computed(() => { | ||
return user.railDrawer ? 'mdi-chevron-double-right' : 'mdi-chevron-double-left' | ||
}) | ||
function onClick () { | ||
user.railDrawer = !user.railDrawer | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters