I'm trying to set this array to different thing depending on another value and get the error
[Vue warn]: You may have an infinite update loop in a component render function.
I'm setting up the array as empty in the data()
in the vue,
ranktexts: [],
and then in the methods i'm using this code
texts(rank) {
if (rank === 3) {
this.ranktexts = ['Mal', 'Indiferente', 'Bueno'];
} else if (rank === 4) {
this.ranktexts = ['Mal', 'Indiferente', 'Bueno', 'Excelente'];
} else if (rank === 5) {
this.ranktexts = ['Muy Mal', 'Mal', 'Indiferente', 'Bueno', 'Excelente'];
} else {
this.ranktexts = ['Muy Mal', 'Mal', 'Indiferente', 'Bueno', 'Muy Bueno', 'Excelente'];
}
},
This is where I'm calling it
<div class="question_reply" v-if="form.response_type_id === 3">
<el-form-item>
<el-rate v-model="value"
:max="form.rank"
:texts="texts(form.rank)"
show-text
allow-half
></el-rate>
</el-form-item>