站内搜索:
首页 >> 前端 >> 内容
ESLint检测vue的ES6字符串模板(代码)

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

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

  • 上一篇:pyqt入门学习之带鼠标响应事件的QLabel
  • 下一篇:vue子组件改变父组件数据有哪几种方法?
  • 返回顶部