Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Convert Checkbox component to Composition API #126

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 29 additions & 34 deletions lib/components/base/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,38 @@
</template>
<script setup>
import { CheckIcon, DropdownIcon } from '@'
</script>
<script>
import { defineComponent } from 'vue'

export default defineComponent({
props: {
label: {
type: String,
default: '',
},
disabled: {
type: Boolean,
default: false,
},
description: {
type: String,
default: '',
},
modelValue: Boolean,
clickEvent: {
type: Function,
default: () => {},
},
collapsingToggleStyle: {
type: Boolean,
default: false,
},

const emit = defineEmits(['update:modelValue'])
Mysterious-Dev marked this conversation as resolved.
Show resolved Hide resolved

const props = defineProps({
label: {
type: String,
default: '',
},
emits: ['update:modelValue'],
methods: {
toggle() {
if (!this.disabled) {
this.$emit('update:modelValue', !this.modelValue)
}
},
disabled: {
type: Boolean,
default: false,
},
description: {
type: String,
default: '',
},
modelValue: Boolean,
clickEvent: {
type: Function,
default: () => {},
},
collapsingToggleStyle: {
type: Boolean,
default: false,
},
})
Mysterious-Dev marked this conversation as resolved.
Show resolved Hide resolved

function toggle() {
if (!props.disabled) {
emit('update:modelValue', !props.modelValue)
}
}
</script>

<style lang="scss" scoped>
Expand Down