summaryrefslogtreecommitdiff
path: root/components/FilePreview.vue
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-24 16:09:39 +0200
committerSanto Cariotti <santo@dcariotti.me>2022-09-24 16:09:39 +0200
commit39dfd080674632b57f7436d7e9b4905c83a38af5 (patch)
tree04ba6c4686091f25a19f7059c502a135d1c8108e /components/FilePreview.vue
parent6c870e85cc152cb83855e74e1fc93302c6f96fe2 (diff)
Use PreviewFile also in model index page
Diffstat (limited to 'components/FilePreview.vue')
-rw-r--r--components/FilePreview.vue12
1 files changed, 7 insertions, 5 deletions
diff --git a/components/FilePreview.vue b/components/FilePreview.vue
index a738a93..5c0f3db 100644
--- a/components/FilePreview.vue
+++ b/components/FilePreview.vue
@@ -1,6 +1,6 @@
<template lang="pug">
- .file-preview
- img(
+ .file-preview.h-full
+ img.h-full.block.mx-auto(
v-if="isImage(path)"
:src="baseAPI + '' + path"
)
@@ -8,12 +8,14 @@
v-else-if="isStl(path)"
:rotate="rotate"
:src="baseAPI + '' + path"
- :backgroundColor="'#D1D5DB'"
+ :backgroundColor="bg ? bg : '#D1D5DB'"
+ :controlsOptions="{'enablePan': controls ? true : false, 'enableZoom': controls ? true : false, 'enableRotate': controls ? true : false}"
)
model-obj(
v-else-if="isObj(path)"
:src="baseAPI + '' + path"
- :backgroundColor="'#D1D5DB'"
+ :backgroundColor="bg ? bg : '#D1D5DB'"
+ :controlsOptions="{'enablePan': controls ? true : false, 'enableZoom': controls ? true : false, 'enableRotate': controls ? true : false}"
)
</template>
@@ -22,7 +24,7 @@ import { ModelStl, ModelObj } from "vue-3d-model";
export default {
name: "FilePreview",
- props: ["path"],
+ props: ["path", "bg", "controls"],
data() {
return {
baseAPI: "",