0.1.1 • Published 7 years ago

u-switch.vue v0.1.1

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

Switch

Examples

Basic

<u-switch></u-switch>

v-model & Text

<template>
<u-switch v-model="value" width="wide">{{ value ? 'ON' : 'OFF' }}</u-switch>
</template>
<script>
export default {
    data() {
        return { value: false };
    },
};
</script>

Readonly & Disabled

<u-linear-layout>
    <u-switch readonly></u-switch>
    <u-switch disabled></u-switch>
</u-linear-layout>

API

Attrs/Props

Attr/PropTypeDefaultDescription
valueBooleanfalseSwitch status.
readonlyBooleanfalseReadonly
disabledBooleanfalseDisabled

Slots

SlotDescription
(default)

Events

@input

Emit when checking.

PropertyTypeDescription
valueBooleanChecked value

@change

Emit when change value.

PropertyTypeDescription
newValueBooleanNew value
oldValueBooleanOld value