feat (UI/sub-editor): Add speed dial for quick saving and adding operations (#129)

This commit is contained in:
Jacob Lee
2022-06-24 17:22:59 +08:00
committed by GitHub
parent a1df2de7e2
commit 730986fed4
2 changed files with 365 additions and 165 deletions

View File

@@ -0,0 +1,74 @@
<template>
<v-speed-dial
class="float-menu-switch"
v-model="fab"
:top="top"
:bottom="bottom"
:right="right"
:left="left"
:direction="direction"
:open-on-hover="hover"
:transition="transition"
>
<template v-slot:activator>
<v-btn v-model="fab" color="primary" dark fab>
<v-icon v-if="fab"> mdi-close</v-icon>
<v-icon v-else> mdi-gesture-double-tap</v-icon>
</v-btn>
</template>
<slot></slot>
</v-speed-dial>
</template>
<script>
export default {
name: "FloatMenu",
data() {
return {
direction: "top",
fab: false,
fling: false,
hover: false,
tabs: null,
top: false,
right: true,
bottom: true,
left: false,
transition: "scale-transition",
};
},
watch: {
top(val) {
this.bottom = !val;
},
right(val) {
this.left = !val;
},
bottom(val) {
this.top = !val;
},
left(val) {
this.right = !val;
},
},
};
</script>
<style lang="scss" scoped>
.float-menu-switch {
position: fixed;
bottom: 80px;
right: 20px;
> .v-btn {
width: 40px;
height: 40px;
}
}
/* This is for documentation purposes and will not be needed in your application */
#create .v-speed-dial {
position: absolute;
}
#create .v-btn--floating {
position: relative;
}
</style>