web โฉ component โฉ slot โฉ named slot
<slot> ๅ งๆไพ็้ ่จญๅ งๅฎนใๅฆๆ่ช่จ็ web component ๆจ็ฑคๅ งๆฒๆๆไพไปปไฝๅ งๅฎน๏ผๅๆ้กฏ็คบ้ ่จญๅ งๅฎนใ
<slot>
named slot๏ผๅฏๆงๅถๅ งๅฎน็ๆๅ ฅไฝ็ฝฎใ
็จๆณ
<template id="my-component-template"> <div class="container"> <!-- โญ๏ธ ๅ งๅซ้ ่จญๅ งๅฎน็ <slot> --> <slot>This is the default content if nothing is provided.</slot> </div> </template>
<my-component></my-component>
Last updated 3 months ago
Was this helpful?