other components... (2)
This commit is contained in:
41
src/components/CPreloadImages/CPreloadImages.ts
Executable file
41
src/components/CPreloadImages/CPreloadImages.ts
Executable file
@@ -0,0 +1,41 @@
|
||||
import { defineComponent, ref, computed, PropType } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { IPreloadImages } from 'model'
|
||||
import { tools } from '@store/Modules/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,
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user