JSFiddle - React, Tailwind, and code Playground

by leopoldthecuber

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.3/vue.js"></script>
<div id="app"></div>

JavaScript

Vue.component('my-component', {
  mounted() {
    alert(this.$el.clientWidth);
  },
  template: `
    <p>This is my component.</p>
  `
});

var App = Vue.extend();

new App({
  el: '#app',
  data() {
    return {
      visible: false
    }
  },
  template: `
    <div>
      <div v-show="visible">
        <my-component><my-component>
      </div>    
    </div>
  `
})