Files
pojazdownik/src/mixins/imageMixin.ts
T

18 lines
483 B
TypeScript

import { defineComponent } from 'vue';
export default defineComponent({
methods: {
getIconURL(name: string, ext = 'svg'): string {
return `/images/icon-${name}.${ext}`;
},
getThumbnailURL(vehicleType: string, size: 'small' | 'large') {
return `${
import.meta.env.VITE_API_DEV === '1'
? 'http://localhost:5500'
: 'https://static.spythere.eu'
}/images/${vehicleType}--${size == 'small' ? 300 : 800}px.jpg`;
},
},
});