JSFiddle - React, Tailwind, and code Playground

by skirtle

HTML

<script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>
<div id="app">
  <component :is="layout">
    <div slot="embed" ref="embed"></div>
  </component>
</div>

JavaScript

Vue.createApp({
  components: {
    MyChild: {
      template: `<button><slot/></button>`
    }
  },
  
  data () {
    return { layout: 'MyChild' }
  },
  
  mounted () {
    console.log(this.$refs.embed)
  }
}).mount('#app')