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}`)
})

猜你喜欢

转载自blog.csdn.net/qq_37144354/article/details/80219579