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.
-
Attributes with
:
i.e. property bound attributes, can accessvue
instancedata
properties,methods
,computed
properties. -
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'
}
}
}
Source:stackexchange.com