您现在的位置:首页 >> 前端 >> 内容

ESLint检测vue的ES6字符串模板(代码)

时间:2018/5/9 14:43:43 点击:

  核心提示: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}`)  
})  

Tags:ES SL LI IN 
作者:网络 来源:Lee的430博客