enhance(client): improve modal menu for mobile

This commit is contained in:
syuilo
2021-12-17 02:14:40 +09:00
parent 6d6162333e
commit 6ab2c7780c
10 changed files with 340 additions and 393 deletions

View File

@@ -1,8 +1,8 @@
<template>
<div ref="items" v-hotkey="keymap"
class="rrevdjwt"
:class="{ center: align === 'center' }"
:style="{ width: width ? width + 'px' : null, maxHeight: maxHeight ? maxHeight + 'px' : null }"
:class="{ center: align === 'center', asDrawer }"
:style="{ width: (width && !asDrawer) ? width + 'px' : null, maxHeight: maxHeight ? maxHeight + 'px' : null }"
@contextmenu.self="e => e.preventDefault()"
>
<template v-for="(item, i) in items2">
@@ -56,6 +56,10 @@ export default defineComponent({
type: Boolean,
required: false
},
asDrawer: {
type: Boolean,
required: false
},
align: {
type: String,
requried: false
@@ -279,5 +283,29 @@ export default defineComponent({
height: 1px;
background: var(--divider);
}
&.asDrawer {
padding: 12px 0;
width: 100%;
> .item {
font-size: 1em;
padding: 12px 24px;
&:before {
width: calc(100% - 24px);
border-radius: 12px;
}
> i {
margin-right: 14px;
width: 24px;
}
}
> .divider {
margin: 12px 0;
}
}
}
</style>