V
V
VueJS Generators
GitHub
NPM
JSFiddle
CodePen
Search…
1.0.0
Getting Started
Installation
Usage
Component
Fields
Field Properties
Core Fields
Optional Fields
cleave
dateTimePicker
googleAddress
image
masked
noUiSlider
pikaday
selectEx
rangeSlider
spectrum
staticMap
switch
vueMultiSelect
Custom Fields
Groups
Validation
Powered By
GitBook
switch
This is a switch/toogle input field for any values. It can toggle true/false, yes/no, on/off values.
Special properties of field
Property
Default
Accepted values
Description
textOn
none
String
Visible label if the switch state is on
textOff
none
String
Visible label if the switch state is off
valueOn
none
any primitives or
Object
Value if the switch state is on
valueOff
none
any primitives or
Object
Value if the switch state is off
Usage
Simple example with active/inactive labels
1
{
2
type
:
"switch"
,
3
label
:
"Status (switch field)"
,
4
model
:
"status"
,
5
textOn
:
"Active"
,
6
textOff
:
"Inactive"
7
}
Copied!
Example with male/female model values
1
{
2
type
:
"switch"
,
3
label
:
"Sex"
,
4
model
:
"sex"
,
5
textOn
:
"Female"
,
6
textOff
:
"Male"
,
7
valueOn
:
"female"
,
8
valueOff
:
"male"
9
}
Copied!
Previous
staticMap
Next
vueMultiSelect
Last modified
3yr ago
Copy link
Contents
Special properties of field
Usage