插槽
我们先来看一个案例
<div id="app">
<father></father>
</div>
<template id="father">
<div>
我是父组件
<son></son>
</div>
</template>
<template id="son">
<div>
<div>我是头部</div>
<div>我是底部</div>
</div>
</template>
<script>
// 父组件
Vue.component("father", {
template: "#father",
// 子组件
components: {
"son": {
template: "#son",
}
}
});
// 这里就是MVVM中的View Model