解决国密算法sm-crypto有ie兼容问题
解决ie兼容问题
插件包sm-crypto本身不兼容ie浏览器
通过以下配置解决ie浏览器兼容问题
-
在
vue.config.js
的transpileDependencies
中把我们的包添加进去,让babel-loader能够帮我们转译sm-crypto
包中的内容:module.exports = { // ... transpileDependencies: [ 'sm-crypto' ] }
-
babel.config.js
中对应位置添加如下配置:module.exports = { // ... sourceType: 'unambiguous' }