Enhance Checkbox to use bind:group

This commit is contained in:
Gregor Wassmann 2021-12-27 23:31:56 +01:00
commit ede294d553
6 changed files with 54 additions and 5 deletions

View file

@ -3,12 +3,21 @@
* @event {boolean} check
*/
/** Specify the value of the checkbox */
/**
* Specify the value of the checkbox
* @type {string | any}
*/
export let value = "";
/** Specify whether the checkbox is checked */
export let checked = false;
/**
* Specify the bound group
* @type {any[]}
*/
export let group = [];
/** Specify whether the checkbox is indeterminate */
export let indeterminate = false;
@ -71,6 +80,7 @@
>
<input
bind:this="{ref}"
bind:group
type="checkbox"
value="{value}"
checked="{checked}"