问题
使用eval,vue eslint会报 eval can be harmful
解决
// 解决 使用eval,vue eslint会报 eval can be harmful
evil (fn) {
// 一个变量指向Function,防止有些前端编译工具报错
let Fn = Function
return new Fn('return ' + fn)()
},
// eval('this.echartsData.keywords = (' + keywordsTemp + ')')
// 等价
this.echartsData.keywords = this.evil(keywordsTemp)