Added optional id attribute to ToggleSwitch.

This commit is contained in:
Fabio Manganiello 2023-12-09 16:12:08 +01:00
parent 4b578c38c8
commit 34e2a59285
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -1,7 +1,7 @@
<template> <template>
<div class="power-switch" :class="{disabled: disabled}" @click.stop="onInput"> <div class="power-switch" :class="{disabled: disabled}" @click.stop="onInput">
<!--suppress HtmlFormInputWithoutLabel --> <!--suppress HtmlFormInputWithoutLabel -->
<input type="checkbox" :checked="value"> <input type="checkbox" :checked="value" :id="id">
<label> <label>
<!--suppress HtmlUnknownTag --> <!--suppress HtmlUnknownTag -->
<div class="switch"> <div class="switch">
@ -19,6 +19,10 @@ export default {
name: "ToggleSwitch", name: "ToggleSwitch",
emits: ['input'], emits: ['input'],
props: { props: {
id: {
type: String,
},
value: { value: {
type: Boolean, type: Boolean,
default: false, default: false,