vue $slot基本用法


slot內容分發

 

如果有first傳入 ,下面first就被替換,如果沒有first傳入,則顯示下面模塊中的內容

<children> 
			<span slot="first">【12345】</span> 
		</children> 

<div><slot name='first'><button>【如果沒有內容則顯示我1】</button></slot>為了明確作用范圍,<slot name='last'><button>【如果沒有內容則顯示我2】</button></slot>所以使用button標簽</div>

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM