refactorings + basis of script editor.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<script lang="ts">
|
||||
import BFormOption from "./BFormOption.svelte";
|
||||
|
||||
export let value: boolean | null;
|
||||
|
||||
function toggle() {
|
||||
if (value === null) {
|
||||
value = true;
|
||||
} else if (value === true) {
|
||||
value = false;
|
||||
} else {
|
||||
value = null;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<BFormOption icon="power" on:click={toggle} state={value} color="#00FF00"></BFormOption>
|
||||
Reference in New Issue
Block a user