Time to read: 1 min read
Data is a property that we normally use in almost all the components in the past, to simplify further the implementation in our code we can do thanks to the new syntax of es6 and the arrow functions
Let's see the example of how it is usually used and how we can make it simpler
/*
Template ...
*/
<script>
export default {
data () {
return {
myDataProp: 0
}
},
}
</script>
/*
Styles ...
*/
/*
Template ...
*/
<script>
export default {
data:() => ({
myDataProp: 0
}),
}
</script>
/*
Styles ...
*/