You've already forked AstralRinth
forked from didirus/AstralRinth
Convert Checkbox component to Composition API (#126)
* Convert Checkbox component to Composition API * Apply suggestions from brawaru * Fix lint error * Apply suggestions from brawaru
This commit is contained in:
@@ -23,45 +23,37 @@
|
|||||||
<slot v-else />
|
<slot v-else />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup lang="ts">
|
||||||
import { CheckIcon, DropdownIcon } from '@'
|
import { CheckIcon, DropdownIcon } from '@'
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
import { defineComponent } from 'vue'
|
|
||||||
|
|
||||||
export default defineComponent({
|
const emit = defineEmits<{
|
||||||
props: {
|
'update:modelValue': [boolean]
|
||||||
label: {
|
}>()
|
||||||
type: String,
|
|
||||||
default: '',
|
const props = withDefaults(
|
||||||
},
|
defineProps<{
|
||||||
disabled: {
|
label: string
|
||||||
type: Boolean,
|
disabled?: boolean
|
||||||
default: false,
|
description: string
|
||||||
},
|
modelValue: boolean
|
||||||
description: {
|
clickEvent?: () => void
|
||||||
type: String,
|
collapsingToggleStyle?: boolean
|
||||||
default: '',
|
}>(),
|
||||||
},
|
{
|
||||||
modelValue: Boolean,
|
label: '',
|
||||||
clickEvent: {
|
disabled: false,
|
||||||
type: Function,
|
description: '',
|
||||||
default: () => {},
|
modelValue: false,
|
||||||
},
|
clickEvent: () => {},
|
||||||
collapsingToggleStyle: {
|
collapsingToggleStyle: false,
|
||||||
type: Boolean,
|
}
|
||||||
default: false,
|
)
|
||||||
},
|
|
||||||
},
|
function toggle() {
|
||||||
emits: ['update:modelValue'],
|
if (!props.disabled) {
|
||||||
methods: {
|
emit('update:modelValue', !props.modelValue)
|
||||||
toggle() {
|
}
|
||||||
if (!this.disabled) {
|
}
|
||||||
this.$emit('update:modelValue', !this.modelValue)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user