-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ vue-dot: Add show-nav-bar-menu-btn & mobile-version props to Heade…
…rBar (#1728)
- Loading branch information
Showing
25 changed files
with
326 additions
and
165 deletions.
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
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
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,63 +1,30 @@ | ||
<template> | ||
<HeaderBar | ||
:mobile-version="$vuetify.breakpoint.mdAndDown" | ||
app | ||
fixed | ||
clipped-left | ||
service-title="Design System" | ||
@click="emitDrawerEvent" | ||
> | ||
<template #navigation-bar-content> | ||
<div | ||
v-if="!$vuetify.breakpoint.lgAndUp" | ||
class="d-flex align-center" | ||
> | ||
<VBtn | ||
:aria-label="menuBtnActionLabel" | ||
:elevation="0" | ||
color="transparent" | ||
class="mx-n2" | ||
@click="emitDrawerEvent" | ||
> | ||
<VIcon class="mr-2"> | ||
{{ menuIcon }} | ||
</VIcon> | ||
|
||
Menu | ||
</VBtn> | ||
</div> | ||
<template #navigation-drawer="{ drawer, updateDrawer }"> | ||
<DocDrawer | ||
:value="drawer" | ||
@input="updateDrawer" | ||
/> | ||
</template> | ||
</HeaderBar> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue'; | ||
import Component, { mixins } from 'vue-class-component'; | ||
import { mdiMenu } from '@mdi/js'; | ||
const Props = Vue.extend({ | ||
props: { | ||
drawer: { | ||
type: Boolean, | ||
default: false | ||
} | ||
} | ||
}); | ||
import Component from 'vue-class-component'; | ||
const MixinsDeclaration = mixins(Props); | ||
@Component | ||
export default class DocHeader extends MixinsDeclaration { | ||
menuIcon = mdiMenu; | ||
get menuBtnActionLabel(): string { | ||
const action = this.drawer ? 'Masquer' : 'Afficher'; | ||
return `${action} le menu`; | ||
} | ||
import DocDrawer from '../components/drawer/DocDrawer.vue'; | ||
emitDrawerEvent(): void { | ||
this.$emit('update:drawer', !this.drawer); | ||
@Component({ | ||
components: { | ||
DocDrawer | ||
} | ||
} | ||
}) | ||
export default class DocHeader extends Vue {} | ||
</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
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
30 changes: 30 additions & 0 deletions
30
packages/docs/src/content/examples/header-bar/nav-bar-menu-btn.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,30 @@ | ||
<template> | ||
<HeaderBar | ||
:navigation-items="navigationItems" | ||
theme="ameli-pro" | ||
mobile-version | ||
show-nav-bar-menu-btn | ||
/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue'; | ||
import Component from 'vue-class-component'; | ||
import { NavigationItem } from '@cnamts/vue-dot/src/patterns/HeaderBar/types'; | ||
@Component | ||
export default class HeaderBarNavBarMenuBtn extends Vue { | ||
navigationItems: NavigationItem[] = [ | ||
{ | ||
label: 'Accueil' | ||
}, | ||
{ | ||
label: 'Mes projets' | ||
}, | ||
{ | ||
label: 'Mes outils' | ||
} | ||
]; | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,9 @@ | |
]; | ||
options = { | ||
booleans: [ | ||
'mobileVersion' | ||
], | ||
selects: { | ||
theme: [ | ||
'default', | ||
|
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
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
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
Oops, something went wrong.