<script src="https://rawgit.com/yyx990803/vue/master/dist/vue.js"></script>
<div id="app">
<!-- <c1>My slot data</c1> -->
<!-- <c1></c1> -->
<!-- <c2></c2> -->
<!-- <c2>this will go in the unnamed</c2> -->
<c2><span slot="first">Now some custom h1 action</span>this goes in last unnamed</c2>
</div>
Babel + JSX
Vue.component('c1', {
template: '<div><slot>Some default data</slot></div>',
});
Vue.component('c2', {
template: '<div><h1><slot name="first">Some default data for our first</slot></h1><h2><slot name="second">Some default data for our second</slot></h2><h3><slot>some default data when nothing is passed</slot></h3></div>',
});
new Vue({
el: '#app'
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.