问题描述
所以我在 vue 项目中采用了 v-calender(https://vcalendar.io/) 库
我的项目必须覆盖 IE11 环境,但我有
并坚持 IE11 错误(SCRIPT1010:预期标识符)
我是否错过了一些 babel 配置?
错误脚本
Object(r["k"])(e,"touchmove",s,{passive:!0}),Object(r["k"])
(e,"click",c,\n{passive:!0}),Object(r["k"])(e,"touchend",function(){Object(r["j"])
(e,"touchstart",i),Object(r["j"])(e,s),c),Object(r["j"])
(e,c)}},i=
function(e,t,{maxSwipeTime:n,minHorizontalSwipeDistance:o,maxVerticalSwipeDistance:i})
{if(!e||!e.addEventListener||!Object(a["k"])(t))return null;let s=0,c=0,u=null,l=!1;function d(e)
{const t=e.changedTouches[0];s=t.screenX,c=t.screenY,u=(new Date).getTime(),l=!0}function f(e)
{if(!l)return;l=!1;const r=e.changedTouches[0],a=r.screenX-s,d=r.screenY-c,f=(new Date).getTime()-
u;if(f<n&&Math.abs(a)>=o&&Math.abs(d)<=i){const e={toLeft:!1,toRight:!1};a<0?
e.toLeft=!0:e.toRight=!0,t(e)}}
//Error occured in here
function(e,m
配置
//vue.config.js
configureWebpack: {
entry: ["@babel/polyfill","./src/main.js"]
},//main.js
import "@babel/polyfill";
//babel.config.js
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
//package.json
"dependencies": {
"@babel/polyfill": "^7.12.1","axios": "^0.19.2","jquery": "^3.5.1","material-design-icons-iconfont": "^3.0.3","request": "^2.88.2","v-calendar": "^2.3.0","vee-validate": "^2.1.7","vue": "^2.6.13","vue-awesome-swiper": "^3.1.3","vue-cookies": "^1.7.2","vue-i18n": "^8.16.0","vue-js-popover": "^1.1.8","vue-router": "^3.0.1","vue-simple-progress": "^1.1.1","vue-simple-spinner": "^1.2.8","vue-toasted": "^1.1.28","vuex": "^3.0.1"
},"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.13","@vue/cli-service": "^4.5.13","node-sass": "^6.0.0","sass-loader": "^12.0.0","vue-template-compiler": "^2.6.13"
},
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)