多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
494 B

const useAttachment = () => {
const { appInfo } = useGlobal()
const getAttachmentSrc = (item: Record<string, any>) => {
if (item.data) {
return item.data
} else if (item.path) {
return `${appInfo.value.ncSiteUrl}/${item.path}`
}
return item.url
}
const showFallback = (evt: any, item: Record<string, any>) => {
evt.onerror = null
evt.target.src = item.url
}
return {
getAttachmentSrc,
showFallback,
}
}
export default useAttachment