devextreme-vue
Version:
DevExtreme Vue UI and Visualization Components
97 lines (95 loc) • 2.98 kB
JavaScript
/*!
* devextreme-vue
* Version: 25.1.5
* Build date: Wed Sep 03 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file in the root of the project for details.
*
* https://github.com/DevExpress/devextreme-vue
*/
import { defineComponent } from "vue";
import { prepareComponentConfig } from "./core/index";
import Switch from "devextreme/ui/switch";
const componentConfig = {
props: {
accessKey: String,
activeStateEnabled: Boolean,
disabled: Boolean,
elementAttr: Object,
focusStateEnabled: Boolean,
height: [Number, String],
hint: String,
hoverStateEnabled: Boolean,
isDirty: Boolean,
isValid: Boolean,
name: String,
onContentReady: Function,
onDisposing: Function,
onInitialized: Function,
onOptionChanged: Function,
onValueChanged: Function,
readOnly: Boolean,
rtlEnabled: Boolean,
switchedOffText: String,
switchedOnText: String,
tabIndex: Number,
validationError: {},
validationErrors: Array,
validationMessageMode: String,
validationMessagePosition: String,
validationStatus: String,
value: Boolean,
visible: Boolean,
width: [Number, String]
},
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:accessKey": null,
"update:activeStateEnabled": null,
"update:disabled": null,
"update:elementAttr": null,
"update:focusStateEnabled": null,
"update:height": null,
"update:hint": null,
"update:hoverStateEnabled": null,
"update:isDirty": null,
"update:isValid": null,
"update:name": null,
"update:onContentReady": null,
"update:onDisposing": null,
"update:onInitialized": null,
"update:onOptionChanged": null,
"update:onValueChanged": null,
"update:readOnly": null,
"update:rtlEnabled": null,
"update:switchedOffText": null,
"update:switchedOnText": null,
"update:tabIndex": null,
"update:validationError": null,
"update:validationErrors": null,
"update:validationMessageMode": null,
"update:validationMessagePosition": null,
"update:validationStatus": null,
"update:value": null,
"update:visible": null,
"update:width": null,
},
model: { prop: "value", event: "update:value" },
computed: {
instance() {
return this.$_instance;
}
},
beforeCreate() {
this.$_WidgetClass = Switch;
this.$_hasAsyncTemplate = true;
}
};
prepareComponentConfig(componentConfig);
const DxSwitch = defineComponent(componentConfig);
export default DxSwitch;
export { DxSwitch };