vite编译ts,静态属性无法识别 #9869
Unanswered
yinminghua
asked this question in
Help/Questions
Replies: 1 comment
-
This has nothing to do with vue, you should go to the vite repository to give feedback |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
我这边使用的 vite+vue3+typescript 开发
当我使用 ts 写了一个单例类 如下
export class UserService {
}
然后,当我使用vite 进行编译后,
发现这个类变成了
class _ {
static _instance = new _;
}
但是,我们在一些浏览器,如android6, 浏览器中访问的时候,发现浏览器 识别了 type="module"这个语法,但是无法识别 static _instance 这个静态属性,导致报错。有谁知道如何解决吗?
Beta Was this translation helpful? Give feedback.
All reactions