使用場景 如開發一個組件,裏面一些子元素希望是有調用着來定義,可以使用slot 一:沒有slot child沒有插槽slot我不展示/child Vue.component('child',{ template:`divchild/div` }) 結果: 註釋:在父組件中調用子組件時給子組件添加插槽內容,如果子組件裏不包含slot/slot元素,則添加的插槽內容會被拋棄 二:默認插槽