<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script src="./node_modules/vue/dist/vue.js"></script>
<script>
Vue.component('myLi', {
template: `
<li>
<slot name="one"></slot>
<slot name="two"></slot>
</li>
`
});
var App = {
template: `
<myLi>
<h2 slot="one">这是一个h2标签</h2>
<h3 slot="two">这是一个h3标签</h3>
</myLi>
`
};
new Vue({
el: '#app',
data: {
},
components: {
App
},
template: `
<ul>
<App />
</ul>
`
});
</script>
</body>
</html>