[Vuejs]-How to pass a property into a kebab-case property?

0👍

You can have the variables in your data properties passed on as props or other attributes by using property binding:

<component :prop-name='value' />

where :prop-name is the property binding short-hand syntax.

  1. Attributes with : i.e. property bound attributes, can access vue instance data properties, methods, computed properties.

  2. Vue Directives on the other hand directly use the vue instance variables without the need of property binding. like:

    v-if='val > 0' 
    

with your component setup like:

export default {
  data () {
    return {
      val: '0'
    }
  }
}

Your posted code

Leave a comment