Vue入门 Demo18 Vue中的插槽(slot)
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" />
<title>Vue中的插槽(slot)</title>
<script src="./vue.js"></script>
</head>
<body>
<div id="app">
<child>
<p>he wen</p>
</child>
</div>
<script>
Vue.component('child',{
template: '<div> <p>hello</p> <slot></slot> </div>'
})
var vm = new Vue({
el: "#app",
methods: {
}
})
</script>
</body>
</html>