使用eval,vue eslint会报 eval can be harmful

eval(this.sevenDateValueList.join('+')   // eval can be harmful
// 解决
evil (fn) {
   let Fn = Function // 一个变量指向Function,防止有些前端编译工具报错
    return new Fn('return ' + fn)()
  }
  this.evil(this.sevenDateValueList.join('+'))

使用eval,vue eslint会报 eval can be harmful
使用eval,vue eslint会报 eval can be harmful

相关文章: