Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(VNavigationDrawer): adding top property for navigation drawer component in vuetify 2 #18607

Open
wants to merge 3 commits into
base: v2-stable
Choose a base branch
from

Conversation

MehdiKhoshnevisz
Copy link

@MehdiKhoshnevisz MehdiKhoshnevisz commented Nov 6, 2023

Description

In one of my font-end projects, I use vuetify2 components. I created a menu component that is opens/expands from the left on the desktop view and opens/expands from the top on the mobile view (which is a hamburger menu).

So, to create this component I've used v-navigation-drawer that it's fine for the desktop view but, on the mobile screen, I couldn't open it from the top!

To solve this problem I've added top property as well as bottom property in vuetify2.
resolves #18606

Markup:

<template>
  <v-container>
    <v-card class="mx-auto overflow-hidden" height="400" width="344">
      <v-system-bar color="deep-purple darken-3"></v-system-bar>

      <v-app-bar color="deep-purple accent-4" dark>
        <v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
      </v-app-bar>

      <!-- Just need to add top property on component -->
      <v-navigation-drawer v-model="drawer" absolute top>
        <v-list nav dense>
          <v-list-item-group
            v-model="group"
            active-class="deep-purple--text text--accent-4"
          >
            <v-list-item v-for="(item, index) in items" :key="index">
              <v-list-item-title>{{ item }}</v-list-item-title>
            </v-list-item>
          </v-list-item-group>
        </v-list>
      </v-navigation-drawer>

      <v-card-text>
        The navigation drawer will appear from the top on smaller size
        screens.
      </v-card-text>
    </v-card>
  </v-container>
</template>

<script>
export default {
  data: () => ({
    drawer: false,
    group: null,
    items: ['Foo', 'Bar', 'Fizz', 'Buzz']
  }),
  watch: {
    group() {
      this.drawer = false;
    }
  }
};
</script>

@MehdiKhoshnevisz MehdiKhoshnevisz changed the base branch from master to v2-dev November 6, 2023 14:21
@MehdiKhoshnevisz MehdiKhoshnevisz changed the title Feature: Adding top property for navigation drawer component Feature: Adding top property for navigation drawer component in vuetify 2 Nov 6, 2023
@MehdiKhoshnevisz MehdiKhoshnevisz changed the title Feature: Adding top property for navigation drawer component in vuetify 2 feat(VNavigationDrawer): adding top property for navigation drawer component in vuetify 2 Nov 6, 2023
@MajesticPotatoe MajesticPotatoe added T: feature A new feature C: VDataTable VDatatable labels Nov 7, 2023
@MehdiKhoshnevisz
Copy link
Author

Hey @MajesticPotatoe
Couldn't understand why the check failed!

@MajesticPotatoe
Copy link
Member

Hey @MajesticPotatoe Couldn't understand why the check failed!

Nothing on your end, just something with gh actions it seems

@MehdiKhoshnevisz MehdiKhoshnevisz force-pushed the feat/top-prop-for-navigation-drawer-component branch from df70bfe to 66b8a9b Compare November 8, 2023 22:19
@MehdiKhoshnevisz
Copy link
Author

could be merged? @johnleider

@johnleider johnleider added C: VNavigationDrawer VNavigationDrawer and removed C: VDataTable VDatatable labs labels Jan 23, 2024
@johnleider
Copy link
Member

If this is a fix it should go to v2-stable.

@MehdiKhoshnevisz MehdiKhoshnevisz changed the base branch from v2-dev to v2-stable January 29, 2024 10:40
Copy link

vercel bot commented Jan 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vuetify-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2024 5:14am

@MehdiKhoshnevisz
Copy link
Author

MehdiKhoshnevisz commented Jan 29, 2024

If this is a fix it should go to v2-stable.

It's done. can you review it again? @johnleider
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VNavigationDrawer VNavigationDrawer T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants