Shivam Mishra
2024-10-02 13:06:30 +05:30
committed by GitHub
parent e0bf2bd9d4
commit 42f6621afb
661 changed files with 15939 additions and 31194 deletions

View File

@@ -1,12 +1,13 @@
<script>
export default {
props: {
value: { type: Boolean, default: false },
modelValue: { type: Boolean, default: false },
size: { type: String, default: '' },
},
methods: {
onClick() {
this.$emit('input', !this.value);
this.$emit('update:modelValue', !this.modelValue);
this.$emit('input', !this.modelValue);
},
},
};
@@ -16,12 +17,12 @@ export default {
<button
type="button"
class="toggle-button p-0"
:class="{ active: value, small: size === 'small' }"
:class="{ active: modelValue, small: size === 'small' }"
role="switch"
:aria-checked="value.toString()"
:aria-checked="modelValue.toString()"
@click="onClick"
>
<span aria-hidden="true" :class="{ active: value }" />
<span aria-hidden="true" :class="{ active: modelValue }" />
</button>
</template>