| Name | Type | Default |
|
checked
# |
Boolean
|
false
|
Sets or gets the check state.
<template>
<JqxSwitchButton ref="mySwitchButton" :checked="true" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
disabled
# |
Boolean
|
false
|
Sets or gets whether the switch button is disabled.
<template>
<JqxSwitchButton ref="mySwitchButton" :disabled="true" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
height
# |
Number | String
|
null
|
Sets or gets the height.
<template>
<JqxSwitchButton ref="mySwitchButton" :height="50" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
orientation
# |
String
|
'horizontal'
|
Determines the jqxSwitchButton's orientation.
Possible Values:
'horizontal'
'vertical'
<template>
<JqxSwitchButton ref="mySwitchButton" :orientation="'vertical'" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
onLabel
# |
String
|
'On'
|
Sets or gets the string displayed when the button is checked.
<template>
<JqxSwitchButton ref="mySwitchButton" :onLabel="'On Label'" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
offLabel
# |
String
|
'Off'
|
Sets or gets the string displayed when the button is unchecked.
<template>
<JqxSwitchButton ref="mySwitchButton" :offLabel="'Off Label'" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
theme
# |
String
|
''
|
Sets the widget's theme.
<template>
<JqxSwitchButton ref="mySwitchButton"
:theme="'material'"
/>
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
thumbSize
# |
String
|
'40%'
|
Sets or gets the size of the thumb in percentages.
<template>
<JqxSwitchButton ref="mySwitchButton" :thumbSize="'30%'" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
rtl
# |
Boolean
|
false
|
<template>
<JqxSwitchButton ref="mySwitchButton" :rtl="true" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
width
# |
Number | String
|
null
|
Sets or gets the width.
<template>
<JqxSwitchButton ref="mySwitchButton" :width="50" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
</script>
|
|
|
|
checked
# |
Event
|
|
This event is triggered when the switch button is checked.
Code examples #
Bind to the checked event of jqxSwitchButton.
<template>
<JqxSwitchButton ref="mySwitchButton" @checked="onChecked($event)" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
function onChecked(event) {
alert('do something...');
}
</script>
|
|
change
# |
Event
|
|
This event is triggered when the switch button's state changes from one state to another.
Code examples #
Bind to the change event of jqxSwitchButton.
<template>
<JqxSwitchButton ref="mySwitchButton" @change="onChange($event)" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
function onChange(event) {
alert('do something...');
}
</script>
|
|
unchecked
# |
Event
|
|
This event is triggered when the switch button is unchecked.
Code examples #
Bind to the unchecked event of jqxSwitchButton.
<template>
<JqxSwitchButton ref="mySwitchButton" @unchecked="onUnchecked($event)" />
</template>
<script setup>
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
function onUnchecked(event) {
alert('do something...');
}
</script>
|
|
|
| Name | Arguments | Return Type |
|
check
# |
None
|
None
|
Checks the button.
<template>
<JqxSwitchButton ref="mySwitchButton" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
const mySwitchButton = ref(null);
onMounted(() => {
mySwitchButton.value.check();
});
</script>
|
|
disable
# |
None
|
None
|
Disables the switch button.
<template>
<JqxSwitchButton ref="mySwitchButton" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
const mySwitchButton = ref(null);
onMounted(() => {
mySwitchButton.value.disable();
});
</script>
|
|
enable
# |
None
|
None
|
Enables the switch button.
<template>
<JqxSwitchButton ref="mySwitchButton" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
const mySwitchButton = ref(null);
onMounted(() => {
mySwitchButton.value.enable();
});
</script>
|
|
toggle
# |
None
|
None
|
Toggles the check state. This method is automatically called when the user clicks the switch button.
<template>
<JqxSwitchButton ref="mySwitchButton" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
const mySwitchButton = ref(null);
onMounted(() => {
mySwitchButton.value.toggle();
});
</script>
|
|
uncheck
# |
None
|
None
|
Unchecks the button.
<template>
<JqxSwitchButton ref="mySwitchButton" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
const mySwitchButton = ref(null);
onMounted(() => {
mySwitchButton.value.uncheck();
});
</script>
|
|
val
# |
value
|
Boolean
|
Sets or gets the value.
<template>
<JqxSwitchButton ref="mySwitchButton" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSwitchButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxswitchbutton.vue';
const mySwitchButton = ref(null);
onMounted(() => {
const value = mySwitchButton.value.val();
});
</script>
|