Simple understanding of vue's slot slot

Slot means slot, think about the various slots on your computer motherboard, some are plugged in CPU, some are plugged in graphics card, some are plugged in memory, some are plugged in hard disk, so suppose a component is computer, its template Yes
< template > 
  < div > 
    < slot name ="CPU" > plug your CPU here </ slot > 
    < slot name =" GPU" > plug your graphics card here </ slot > 
    < slot name =" Memory" > plug here your memory </ slot > 
    < slot name ="Hard-drive" > insert your hard drive here </ slot > 
  </ div > 
</ template >

 

Then if you want to save a great computer, you can write:
<template>
    <computer>
      <div slot="CPU">Intel Core i7</div>
      <div slot="GPU">GTX980Ti</div>
      <div slot="Memory">Kingston 32G</div>
      <div slot="Hard-drive">Samsung SSD 1T</divt>
    </computer>
</template>

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325009068&siteId=291194637