安装后使用报错了
Closed this issue · 17 comments
hongliangsam commented
pasBone commented
你好, 看起来应该是不支持 optional chain 导致报错的。建议排查和升级下 @vue/cli-plugin-babel 的版本再试下,如果还是不行的话再贴下package.json的截图哈。
hongliangsam commented
guijue-code commented
guijue-code commented
解决啦
guijue-code commented
我这边在vue.config.js里加一下mjs的rule,loader使用babel-loader就可以了
hongliangsam commented
我这边在vue.config.js里加一下mjs的rule,loader使用babel-loader就可以了
贴代码看看,谢谢啦
guijue-code commented
guijue-code commented
加了个这个就没有报错了,可以正常运行了
guijue-code commented
但是功能好像出来了又好像没出来,按住control可以正常缩放页面,但是大屏里的小模块好像没有真正实现缩放
pasBone commented
但是功能好像出来了又好像没出来,按住control可以正常缩放页面,但是大屏里的小模块好像没有真正实现缩放
刚刚发布了新版本 0.3.1, 麻烦更新下哈。
在此之前没有测试过vue2.x版本的支持能力,看到反馈后立马加上了对vue2.x的支持。
guijue-code commented
谢谢啦
pasBone commented
可以在 vite.config.js 里面添加以下配置... 因为babel默认是排除了node_modules的。
这个方法也可以哈: #14 (comment)
另外添加了对vue2.x的支持,请更新到 v0.3.1
module.exports = {
transpileDependencies: [
/[/\\]node_modules[/\\]vue-fit-next[/\\]/,
],
configureWebpack: {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
},
]
}
}
}
guijue-code commented
额,请问发布好了吗
pasBone commented
额,请问发布好了吗
发布好了呀。我回复你上一条消息的时候就已经发布好了,你 npm 重新安装下就可以了,版本是0.3.2或者0.3.1
guijue-code commented
好的,谢谢啦
hongliangsam commented
pasBone commented
1、babel.config.js
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
"@babel/plugin-proposal-optional-chaining",
]
}
2、 vue.config.js
module.exports = {
transpileDependencies: [
/[/\\]node_modules[/\\]vue-fit-next[/\\]/,
],
configureWebpack: {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
},
]
}
}
}
设置这两个地方之后是没问题的,我专门使用vue-cli 4.4.4 版本测试过了,请仔细检查下。
如果还不行,建议升级vue-clic版本哈。