Switch

介紹使用 Switch 切換開關元件

Switch 切換開關,通常用在開啟或關閉的功能上。

基本使用

<bpa-switch labelText="text" v-model="isOpen"/>

客製化文字

<bpa-switch labelText="text" v-model="isOpen">
  <template v-slot:close-text><img src="favicon.ico" alt=""/>Off</template>
  <template v-slot:open-text>On👍🏽</template>
</bpa-switch>

屬性

名稱ValueTypeDefault ValueRequired描述
idString隨機
labelTextString
v-slot:close-textString關閉
v-slot:open-textString開啟
Switch Props

事件

名稱ValueTypeDefault ValueRequired描述
changeString隨機
Switch Events

演示