slot-插槽的基本使用
<!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>
<!-- <i> 标签显示斜体文本效果。 -->
<div id="app">
<scpn></scpn>
<scpn><button>按钮</button></scpn>
<scpn>
<i>呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵</i>
<br>
<button>按钮1</button>
<button>按钮2</button>
</scpn>
<scpn>
<button>按钮1</button>
<button>按钮2</button>
<button>按钮3</button>
</scpn>
<scpn></scpn>
</div>
<template id="lcpn">
<div>
<h1>哈哈哈</h1>
<span>我来了</span>
<br>
<slot><h2>hhh</h2></slot>
<!-- <slot></slot> -->
</div>
</template>
<script src="../vue.js"></script>
<script>
const app = new Vue({
el: '#app',
data: {
message: "sb"
},
components: {
scpn: {
template: '#lcpn',
}
}
})
</script>
</body>
</html>