# Switch
To use the switch component, first import it:
import {Switch} from 'src/components'
1
Global usage
Vue.component(Switch.name, Switch)
1
For local usage
export default {
components: {
[Switch.name]: Switch
}
}
1
2
3
4
5
2
3
4
5
# Simple switch
# With text
ON
OFF
ON
OFF
# Slots
# Switch Props
# Events
Event Name | Description | Parameters |
---|---|---|
input | triggers when the binding value changes | the updated value |
# Slots
Name | Description |
---|---|
on | Content to be displayed on switch when switch is on |
off | Content to be displayed on switch when switch is off |