npm install
npm run serve
<template>
<div>
<ToggleButton id="switch" />
</div>
</template>
<script>
import ToggleButton from './components/ToggleButton.vue'
export default {
components: {
ToggleButton
}
}
</script>
<template>
<div>
<ToggleButton
id="switch"
v-on:change="eventHandler"
/>
</div>
</template>
<script>
import ToggleButton from './components/ToggleButton.vue'
export default {
components: {
ToggleButton
},
methods: {
eventHandler(value) {
console.log(value);
}
}
}
</script>
List of available properties to use in this component:
Prop | Data Type | Default | Description |
---|---|---|---|
id |
String |
primary | Element Id |
default-state |
Boolean |
false |
Toggle State (true |
disabled |
Boolean |
false |
Disable the toggle button |
label-enable-text |
String |
On | Active Label |
label-disable-text |
String |
Off | In-Active Label |