Skip to content

Commit

Permalink
use prettier to fix code layout
Browse files Browse the repository at this point in the history
  • Loading branch information
billyc committed Mar 16, 2022
1 parent e688b9f commit 413cb77
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions src/charts/slideshow.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<template>

<vueper-slides v-bind="options" style="padding-bottom: 34px">
<vueper-slide v-for="(slide, i) in slides" :key="i" v-bind="slide">
<template #content>
<div v-if="slide.content" class="vueperslide__content-wrapper" style="flex-direction: row; justify-content: flex-start; align-items: baseline; gap: 10px">
<h3>{{ slide.title }}</h3>
<span>{{ slide.content }}</span>
</div>
</template>
</vueper-slide>
</vueper-slides>

<vueper-slides v-bind="options" style="padding-bottom: 34px">
<vueper-slide v-for="(slide, i) in slides" :key="i" v-bind="slide">
<template #content>
<div
v-if="slide.content"
class="vueperslide__content-wrapper"
style="flex-direction: row; justify-content: flex-start; align-items: baseline; gap: 10px"
>
<h3>{{ slide.title }}</h3>
<span>{{ slide.content }}</span>
</div>
</template>
</vueper-slide>
</vueper-slides>
</template>

<script lang="ts">
Expand All @@ -22,18 +24,18 @@ import { FileSystemConfig } from '@/Globals'
import HTTPFileSystem from '@/js/HTTPFileSystem'
import { hasOwnProperty } from 'vega'
@Component({ components: {VueperSlides, VueperSlide}})
@Component({ components: { VueperSlides, VueperSlide } })
export default class VueComponent extends Vue {
@Prop({ required: true }) fileSystemConfig!: FileSystemConfig
@Prop({ required: true }) subfolder!: string
@Prop({ required: true }) files!: string[]
@Prop({ required: true }) config!: any
private options : { [key: string]: any } = {
"slide-content-outside": "bottom",
"fixed-height": "100%",
"class": "no-shadow",
"bullets": false
private options: { [key: string]: any } = {
'slide-content-outside': 'bottom',
'fixed-height': '100%',
class: 'no-shadow',
bullets: false,
}
private slides: any[] = []
Expand All @@ -43,25 +45,22 @@ export default class VueComponent extends Vue {
private async mounted() {
const fileApi = new HTTPFileSystem(this.fileSystemConfig)
if (this.config != null)
Object.assign(this.options, this.config)
// Delete slide property because this is only used in the loop
if (hasOwnProperty(this.options, 'slides')) {
delete this.options.slides;
}
if (this.config != null) Object.assign(this.options, this.config)
// Delete slide property because this is only used in the loop
if (hasOwnProperty(this.options, 'slides')) {
delete this.options.slides
}
this.slides = []
// Check if defined and iterable
// TODO: throw
if (this.config.slides != null && typeof this.config.slides[Symbol.iterator] === 'function') {
// Resolve relative URLs
for (const data of this.config.slides) {
if (hasOwnProperty(data, 'image')) {
if (!this.r.test(data.image))
data.image = fileApi.cleanURL(`${this.subfolder}/${data.image}`)
data.image = fileApi.cleanURL(`${this.subfolder}/${data.image}`)
}
if (hasOwnProperty(data, 'video')) {
Expand Down

0 comments on commit 413cb77

Please sign in to comment.