Vue 插槽后备
插槽后备是在插槽中没有提供内容时,显示默认内容
<div id="app">
<submit-button></submit-button> <br>
<submit-button>保存</submit-button>
</div>
Vue.component('submit-button', {
template:`
<button type="submit">
<slot>提交</slot>
</button>
`
})
app = new Vue({
el: '#app',
})