<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>slot内容分发</title>
	<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
	<div id="app">
		<my-hello>
            <ul slot="s2">
                <li>aa</li>
                <li>bb</li>
                <li>cc</li>
            </ul>
            我是需要额外显示的组件的内容
            <ul slot="s1">
                <li>1222</li>
                <li>1222</li>
                <li>1222</li>
            </ul>
        </my-hello>
	
	</div>

	<template id="hello">
		<div>
            <slot name='s1'>如果没有内容,就显示</slot>		
            <h3>welcome to itapp</h3>
            <slot>如果没有内容,就显示</slot>	
            
            <slot name='s2'>如果没有内容,就显示</slot>		
		</div>
	</template>

	<script>

		var vm=new Vue({
			el:'#app',
			components:{
				'my-hello':{
					template:'#hello'
				}
			}
		});	
	</script>
</body>
</html>