Have some components rendered from a v-for loop. The refs are defined like this:
:ref="'category_' + index"
This is how these refs appears in console at: console.log(this.$refs)
:
category_0: [VueComponent]
category_1: [VueComponent]
category_2: [VueComponent]
category_3: [VueComponent]
category_4: [VueComponent]
category_5: [VueComponent]
category_6: [VueComponent]
category_7: [VueComponent]
category_8: [VueComponent]
__proto__: Object
If I'm trying to acces like that: console.log(this.$refs.category_0)
, I get undefined.
Any other defined ref (not called 'category_..') is working perfectly.
What seems to be wrong here?
<el-form-item v-for="(category,index) in Object.Products" :key="index"
:label="category.Name">
<Select-product v-model="category.IdSelected" :ref="'category'"
ProductCategory='Ingredient' @return="handleSelectIngredient"/>
</el-form-item>
async handleSelectModelAutomat(item) { var response = await this.post("info/get", {IdModel: item}) this.Object.Products = response.Result console.log(this.$refs) console.log(this.$refs.category_0) }
– Reluctance