vue.jsvuejs2vue-clivue-cli-3vue-cli-4

The $ Does Not Convert Text To Code What Should I Do?


The $ Does Not Convert Text To Code What Should I Do?

if(this.rules.min && this.value.length < this.rules.min){
    return 'Minimum length is ${this.rules.min}'
  }

enter image description here


Solution

  • As Bulent says you need to use backticks quote like that :

    if(this.rules.min && this.value.length < this.rules.min){
      return `Minimum length is ${this.rules.min}`
    }