I have a component, how can I select one of its elements?
I'm trying to get an input that is within this component's template.
There could be multiple components so the queryselector must only parse the current instance of the component.
Vue.component('somecomponent', {
template: '#somecomponent',
props: [...],
...
created: function() {
somevariablehere.querySelector('input').focus();
}
});
Thanks in advance
v-el:el:uniquename
has been replaced by ref="uniqueName"
. The element is then accessed through this.$refs.uniqueName
.