JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/vue@2.1.10/dist/vue.min.js"></script>
<script type="x-template" id="foo">
<div>
<slot></slot>
clientHeight: {{height}}
</div>
</script>
<div id="app">
<foo>
<div v-html="content"></div>
</foo>
</div>
JavaScript
console.log('Vue',Vue.version); // 2.1.10
Vue.component('foo', {
template: '#foo',
data: function() {
return {
height: -1
}
},
updated: function() {
this.height = this.$el.clientHeight;
console.log('updated, clientHeight =', this.height); // seems ok
}
});
new Vue({
el: '#app',
components: ['foo'],
data: { content:'' },
created: function() {
setTimeout(function() {
this.content = 'more height<br>more height<br>more height<br>more height<br>more height<br>'
}.bind(this), 1000);
}
});