-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api方式调用本地可以,线上不行报引入方式有问题。 #338
Comments
你可以按照它的提示改写一下
|
报错,类型“typeof VueViewer”上不存在属性“api”。ts-plugin(2339) |
类型“typeof VueViewer”上不存在属性“api”。ts-plugin(2339) |
我项目是这样注册插件 export default defineNuxtPlugin((nuxtApp) => { |
可以看下是不是引入了错误的入口文件 |
import { api as viewerApi } from "v-viewer/dist/index.umd.js" |
类型文件位于v-viewer/types目录下 正常情况下,直接写import就可以获取到类型文件。 https://stackblitz.com/edit/github-7zp2yt-4d8z6b?file=pages%2Findex.vue 这是最简复现例子,可以对照下改动了哪里的配置 |
还是不行 报一样的错,引入方式。 急急 |
最简例子已经给你了,我这里dev或者build start都正常,无法复现你描述的问题 |
有其他类似api这样调的写法吗? |
@mirari 我也遇到了相同的问题 |
已复现问题,正在修复,感谢反馈 |
麻烦更新版本到3.0.16,已修复该问题 |
@mirari It works, thanks a lot~ |
页面代码
import { api as viewerApi } from "v-viewer"
const showImagesInViewer = (url: string)=> {
viewerApi({
options: {
movable: false,
title: false,
fullscreen: false,
toolbar: false,
zoomable: false,
navbar: false,
transition: false,
},
images: [url]
})
}
线上报错页面打不开, Named export 'api' not found. The requested module 'v-viewer' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using: import pkg from 'v-viewer'; const { api } = pkg;
The text was updated successfully, but these errors were encountered: