0👍
the scope of this.$el.querySelector
will be limited to only ChatComposer.vue hence child component can not able to access div of parent component #myDiv
.
You can trigger event as below in ChatComposer
this.$emit('scroll');
In parent component write ScollToEnd method and use $ref to assign new height
<chat-composer v-bind:userid="userid" v-bind:chats="chats" v-bind:adminid="adminid" @scroll="ScollToEnd"></chat-composer>
..
- [Vuejs]-How to map through lodash and return false in the prop value
- [Vuejs]-Trigger a function when selecting a data in a dropdown menu in Vue
Source:stackexchange.com