mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-20 17:02:16 +00:00
split code to components, add arrow functions
This commit is contained in:
73
resources/js/components/FilesView/FilePreviewActions.vue
Normal file
73
resources/js/components/FilesView/FilePreviewActions.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<div>
|
||||
<chevron-left-icon
|
||||
class="prev"
|
||||
@click.prevent="prev"
|
||||
size="17"
|
||||
></chevron-left-icon>
|
||||
|
||||
<chevron-right-icon
|
||||
class="next"
|
||||
@click.prevent="next"
|
||||
size="17"
|
||||
></chevron-right-icon>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { events } from "@/bus";
|
||||
import { ChevronLeftIcon, ChevronRightIcon } from "vue-feather-icons";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ChevronLeftIcon,
|
||||
ChevronRightIcon,
|
||||
},
|
||||
|
||||
methods: {
|
||||
next: function () {
|
||||
events.$emit("filePreviewAction:next");
|
||||
},
|
||||
prev: function () {
|
||||
events.$emit("filePreviewAction:prev");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@assets/vue-file-manager/_variables";
|
||||
|
||||
.icon-wrapper {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.prev,
|
||||
.next {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background-color: white;
|
||||
color: $text;
|
||||
border-radius: 50%;
|
||||
text-decoration: none;
|
||||
user-select: none;
|
||||
}
|
||||
.next {
|
||||
right: 0;
|
||||
}
|
||||
.prev {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.prev,
|
||||
.next {
|
||||
color: $light-text;
|
||||
background-color: $dark_mode_background;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user