2👍
You can get the children of a component via:
this.$children
- Or, query the child elements via
this.$el.querySelector(...)
- If you want the underlying vue component add the elements have a
__vue__
propertiey
- If you want the underlying vue component add the elements have a
- Or, through the ref attribute and access it via
this.$refs['yourRefname']
but be aware only refs inv-for
are turned into arrays.
Once you’ve got your elements you can count them like in regular JS, if you use this.$ref
just read out the array length.
- [Vuejs]-Pushed items to array seem to be reactive to old object
- [Vuejs]-VueJs Axios – Request headers
Source:stackexchange.com