0.1.1 • Published 7 years ago

u-checkbox.vue v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Checkbox

Examples

Basic

<u-checkbox>Checkbox</u-checkbox>

v-model

<template>
<u-checkbox v-model="value">{{ value }}</u-checkbox>
</template>
<script>
export default {
    data() {
        return {
            value: true,
        };
    },
};
</script>

Disabled

<u-linear-layout>
    <u-checkbox :value="true" readonly>Readonly</u-checkbox>
    <u-checkbox :value="true" disabled>Disabled</u-checkbox>
</u-linear-layout>

Indeterminate

<u-checkbox :value="null">Indeterminate</u-checkbox>

API

Attrs/Props

Attr/PropTypeDefaultDescription
valueBoolean | nullfalseChecked status. null means indeterminate status.
readonlyBooleanfalseReadonly
disabledBooleanfalseDisabled

Slots

SlotDescription
(default)

Events

@input

Emit when checking.

PropertyTypeDescription
valueBoolean | nullChecked value

@change

Emit when change value.

PropertyTypeDescription
newValueBoolean | nullNew value
oldValueBoolean | nullOld value