Files
myprojplanet_vite/src/components/CPreloadImages/CPreloadImages.ts
Surya Paolo bc960d38a1 PASSAGGIO A VITE !
AGG. 1.1.23
2025-03-01 14:14:43 +01:00

43 lines
922 B
TypeScript
Executable File

import type { PropType } from 'vue';
import { defineComponent, ref, computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { useQuasar } from 'quasar'
import type { IPreloadImages } from 'model'
import { tools } from '@tools'
export default defineComponent({
name: 'CPreloadImages',
props: {
arrimg: {
type: Object as PropType<IPreloadImages[]>,
required: true,
},
},
components: {},
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
function getimg(recimg: IPreloadImages) {
if (recimg.mobile) {
const filefull = tools.getimgFullpathbysize(recimg.imgname)
return tools.getimgbysize(filefull.path, filefull.file)
} else {
return recimg.imgname
}
}
function getaltimg(recimg: IPreloadImages) {
return recimg.alt
}
return {
tools,
getimg,
getaltimg,
}
}
})