43 lines
922 B
TypeScript
Executable File
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,
|
|
|
|
}
|
|
}
|
|
})
|