mirari / v-viewer

Image viewer component for vue, supports rotation, scale, zoom and so on, based on viewer.js
https://mirari.cc/v-viewer/
MIT License
2.46k stars 292 forks source link

vue2 v-viewer compile error #318

Closed craftlkhugetree closed 1 month ago

craftlkhugetree commented 5 months ago

in ./node_modules/v-viewer/dist/index.mjs

Syntax Error: Unexpected token, expected ( (16:10)

14 | e[O] = void 0; 15 | var n = !0;

16 | } catch { | ^ 17 | }

mirari commented 5 months ago

vue2 requires the legacy version npm install v-viewer@legacy viewerjs

xd15332538931 commented 4 months ago

你要 vue中 我使用 npm install v-viewer@legacy viewerjs 安装后 运行正常 使用compoment 形式引入时 报错Syntax Error: no such file or directory, open 'D:\companyProject\web_wmsn\node_modules\v-viewer\dist\v-viewer.js'

mirari commented 4 months ago

你要 vue中 我使用 npm install v-viewer@legacy viewerjs 安装后 运行正常 使用compoment 形式引入时 报错Syntax Error: no such file or directory, open 'D:\companyProject\web_wmsn\node_modules\v-viewer\dist\v-viewer.js'

较新版本的v-viewer,入口脚本不是这个路径。检查代码中是否显示指定了引入路径:

import VueViewer from 'v-viewer\dist\v-viewer.js'

改成

import VueViewer from 'v-viewer'