1 line
3.4 KiB
Plaintext
1 line
3.4 KiB
Plaintext
{"version":3,"file":"wd-img.js","sources":["../../../../../../../node_modules/wot-design-uni/components/wd-img/wd-img.vue","../../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL25vZGVfbW9kdWxlcy93b3QtZGVzaWduLXVuaS9jb21wb25lbnRzL3dkLWltZy93ZC1pbWcudnVl"],"sourcesContent":["<template>\n <view :class=\"rootClass\" @click=\"handleClick\" :style=\"rootStyle\">\n <image\n :class=\"`wd-img__image ${customImage}`\"\n :style=\"status !== 'success' ? 'width: 0;height: 0;' : ''\"\n :src=\"src\"\n :mode=\"mode\"\n :lazy-load=\"lazyLoad\"\n @load=\"handleLoad\"\n @error=\"handleError\"\n />\n <slot v-if=\"status === 'loading'\" name=\"loading\"></slot>\n <slot v-if=\"status === 'error'\" name=\"error\"></slot>\n </view>\n</template>\n<script lang=\"ts\">\nexport default {\n name: 'wd-img',\n options: {\n virtualHost: true,\n addGlobalClass: true,\n styleIsolation: 'shared'\n }\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport { addUnit, isDef, objToStyle } from '../common/util'\nimport { imgProps } from './types'\n\nconst props = defineProps(imgProps)\nconst emit = defineEmits(['error', 'click', 'load'])\n\nconst rootStyle = computed(() => {\n const style: Record<string, string | number> = {}\n if (isDef(props.height)) {\n style['height'] = addUnit(props.height)\n }\n if (isDef(props.width)) {\n style['width'] = addUnit(props.width)\n }\n if (isDef(props.radius)) {\n style['border-radius'] = addUnit(props.radius)\n style['overflow'] = 'hidden'\n }\n return `${objToStyle(style)};${props.customStyle}`\n})\n\nconst rootClass = computed(() => {\n return `wd-img ${props.round ? 'is-round' : ''} ${props.customClass}`\n})\n\nconst status = ref<'loading' | 'error' | 'success'>('loading')\n\nfunction handleError(event: Event) {\n status.value = 'error'\n emit('error', event)\n}\nfunction handleClick() {\n if (props.enablePreview && props.src) {\n uni.previewImage({\n urls: [props.src]\n })\n }\n emit('click')\n}\nfunction handleLoad(event: Event) {\n status.value = 'success'\n emit('load', event)\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import './index.scss';\n</style>\n","import Component from 'D:/App/Work/addr/acdr-ui/node_modules/wot-design-uni/components/wd-img/wd-img.vue'\nwx.createComponent(Component)"],"names":["computed","isDef","addUnit","objToStyle","ref","uni"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgBA,MAAA,cAAe;AAAA,EACb,MAAM;AAAA,EACN,SAAS;AAAA,IACP,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,EAClB;AACF;;;;;AAQA,UAAM,QAAQ;AACd,UAAM,OAAO;AAEP,UAAA,YAAYA,cAAAA,SAAS,MAAM;AAC/B,YAAM,QAAyC,CAAA;AAC3C,UAAAC,cAAA,MAAM,MAAM,MAAM,GAAG;AACvB,cAAM,QAAQ,IAAIC,cAAQ,QAAA,MAAM,MAAM;AAAA,MACxC;AACI,UAAAD,cAAA,MAAM,MAAM,KAAK,GAAG;AACtB,cAAM,OAAO,IAAIC,cAAQ,QAAA,MAAM,KAAK;AAAA,MACtC;AACI,UAAAD,cAAA,MAAM,MAAM,MAAM,GAAG;AACvB,cAAM,eAAe,IAAIC,cAAQ,QAAA,MAAM,MAAM;AAC7C,cAAM,UAAU,IAAI;AAAA,MACtB;AACA,aAAO,GAAGC,cAAAA,WAAW,KAAK,CAAC,IAAI,MAAM,WAAW;AAAA,IAAA,CACjD;AAEK,UAAA,YAAYH,cAAAA,SAAS,MAAM;AAC/B,aAAO,WAAW,MAAM,QAAQ,aAAa,EAAE,IAAI,MAAM,WAAW;AAAA,IAAA,CACrE;AAEK,UAAA,SAASI,kBAAqC,SAAS;AAE7D,aAAS,YAAY,OAAc;AACjC,aAAO,QAAQ;AACf,WAAK,SAAS,KAAK;AAAA,IACrB;AACA,aAAS,cAAc;AACjB,UAAA,MAAM,iBAAiB,MAAM,KAAK;AACpCC,sBAAAA,MAAI,aAAa;AAAA,UACf,MAAM,CAAC,MAAM,GAAG;AAAA,QAAA,CACjB;AAAA,MACH;AACA,WAAK,OAAO;AAAA,IACd;AACA,aAAS,WAAW,OAAc;AAChC,aAAO,QAAQ;AACf,WAAK,QAAQ,KAAK;AAAA,IACpB;;;;;;;;;;;;;;;;;;;;;;ACrEA,GAAG,gBAAgB,SAAS;","x_google_ignoreList":[0]} |