Parrent component
<progress-bar
:maxQuote = "maxQuotes"
:currentQuote="allQuotes.length" >
</progress-bar>
data: function() {
return {
allQuotes: [],
maxQuotes: 10
};
},
Progressbar Component
<template>
<div class="container">
<div class="progress">
<div class="progress-bar" :style="{'width': +90 + '%'}">{{current}} / {{max}}</div>
</div>
</div>
</template>
<script>
export default {
props: ["maxQuote", "currentQuote"],
data: function() {
return {
max: this.maxQuote,
current: this.currentQuote
};
}
};
</script>
Here I want to pass the length of my allQuotes[] array
maxQuote prop passed successfully but currentQuote not passed any number , even after array values are increased !