核心提示:ESLint检测vue的ES6字符串模板(代码)//错误代码app.$watch(text, (newText, oldText) = {console.log(${newText} : ${oldT...
ESLint检测vue的ES6字符串模板(代码)
//错误代码 app.$watch('text', (newText, oldText) => { console.log('${newText} : ${oldText}') }) //报错 36:15 error Unexpected template string expression no-template-curly-in-string //*ES6的新语法,小撇号 使用 tab 键上面的引号 ``, 非 enter键旁边的引号'' //正确代码 app.$watch('text', (newText, oldText) => { console.log(`${newText} : ${oldText}`) })