Currently, I am using VUE.js 2 in my project.
Here is my website's DOM structure:
<aside :style="{height : height()}" class="col-sm-4 col-md-3 col-lg-3">...</aside>
<main class="col-sm-8 col-md-9 col-lg-9" ref="userPanelMainContents">...</main>
Below is the script section of my code:
export default {
data() {
return {}
},
methods: {
height () {
return this.$refs.userPanelMainContents ? this.$refs.userPanelMainContents.offsetHeight + 'px' : '0px'
}
}
}
I am trying to obtain the height of userPanelMainContents and apply it dynamically to the aside element. How can I achieve this?