Answer the question
In order to leave comments, you need to log in
How to get block height dynamically in vue?
Hello, tell me how to get the block height dynamically? setInterval comes to mind, but I think it's a bad idea. Also, does it make sense to use computed instead of methods?
<template>
<section ref='height'>
<div class="slider-text">
<h1>TEXT</h1>
<span>lorem ipsum</span>
</div>
</section>
</template>
<script>
export default {
name: 'MainSlider',
data () {
return {
}
},
methods: {
watchHeight() {
console.log(this.$refs.height.clientHeight)
}
},
mounted(){
this.watchHeight()
}
}
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question