ImagePreview 在electron中无法调用
estoi opened this issue · comments
Bug report 🐞
我在electron
中使用了ImagePreview
,但是无法正常工作
Version & Environment
"dependencies": {
"@varlet/touch-emulator": "^3.2.1",
"@varlet/ui": "^3.2.1",
"@vueuse/core": "^10.9.0",
"@vueuse/electron": "^10.9.0",
"pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@iconify-json/mdi": "^1.1.64",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"@unocss/reset": "^0.58.6",
"@varlet/import-resolver": "^3.2.1",
"@varlet/preset-unocss": "^3.2.1",
"@vitejs/plugin-vue": "^5.0.4",
"electron": "^29.1.4",
"electron-builder": "^24.13.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.23.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"sass": "^1.72.0",
"typescript": "^5.2.2",
"unocss": "^0.58.6",
"unplugin-auto-import": "^0.17.5",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.1.6",
"vite-plugin-electron": "^0.28.4",
"vite-plugin-electron-renderer": "^0.14.5",
"vite-plugin-eslint": "^1.8.1",
"vue-tsc": "^1.8.27"
},
Expectation
<script lang="ts" setup>
import { ImagePreview } from '@varlet/ui'
const openImage = () => {
console.log('open image')
ImagePreview('https://varlet.gitee.io/varlet-ui/cat.jpg')
}
</script>
<template>
<var-avatar
class="cursor-pointer"
src="https://varlet.gitee.io/varlet-ui/cat.jpg"
:size="60"
@click="openImage"
/>
</template>
Actual results (or Errors)
![image](https://private-user-images.githubusercontent.com/44252820/316768948-d2b683d8-8980-4784-9648-a77f64b5e36d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzMTY5MzUsIm5iZiI6MTcyNDMxNjYzNSwicGF0aCI6Ii80NDI1MjgyMC8zMTY3Njg5NDgtZDJiNjgzZDgtODk4MC00Nzg0LTk2NDgtYTc3ZjY0YjVlMzZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDA4NTAzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFiOTdiYjIwYmU1NjAwZDIxYTZlNjkyMzEyNzA1MjFjYTcxYTE1NjQ4OTI2OWIyZjQzNjgzNDU1MDczNTVkNDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.LJncB64uK-OuEBtbabVaE5-1NyIbcPNOxVf7XNqN3H0)
Reproduction link
update:换成组件调用了,可以正常工作