Vue Form - Editor Properties
To change the properties of an editor, bind the property that should be changed in the editorOptions object to a component property.
App.vue
- <template>
- <div>
- <DxForm :form-data="employee">
- <DxSimpleItem data-field="firstName" :editor-options="editorOptions" />
- <DxSimpleItem data-field="lastName" />
- <DxSimpleItem data-field="phone" />
- <DxSimpleItem data-field="email" />
- </DxForm>
- <DxCheckBox
- text="Disable the First Name Editor"
- :value="editorOptions.disabled"
- @value-changed="checkBoxValueChanged" />
- </div>
- </template>
- <script>
- import 'devextreme/dist/css/dx.fluent.blue.light.css';
- import { DxForm, DxSimpleItem } from 'devextreme-vue/form';
- import { DxCheckBox } from 'devextreme-vue/check-box';
- const employee = {
- firstName: 'John',
- lastName: 'Heart',
- phone: '+1(213) 555-9392',
- email: 'jheart@dx-email.com'
- };
- export default {
- components: {
- DxForm, DxSimpleItem, DxCheckBox
- },
- data() {
- return {
- employee,
- editorOptions: {
- disabled: false
- }
- };
- },
- methods: {
- checkBoxValueChanged(e) {
- this.editorOptions = { disabled: e.value };
- }
- }
- };
- </script>