Skip to content

Commit

Permalink
Vue: update Typescript Support topic (#5574)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladaskorohodova authored Sep 15, 2023
1 parent 98728df commit 582204a
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
To import component-specific types, use the `DxComponentTypes` declaration where `Component` is the component name:
To get component-specific types, import the `DxComponentTypes` declaration where `Component` is the component name:

<!-- tab: App.vue -->
<template>
Expand All @@ -12,4 +12,20 @@ To import component-specific types, use the `DxComponentTypes` declaration where
const dateType: DxDateBoxTypes.DateType = "datetime";
</script>

You can also [import component-specific types](/concepts/Common/Modularity/02%20DevExtreme%20Modules%20Structure '/Documentation/Guide/Common/Modularity/DevExtreme_Modules_Structure/') from the `devextreme/ui` package.
If you need the same type for multiple components, you can also import this type from `common` submodule:

<!-- tab: App.vue -->
// In the sample below, ValidationRule is imported for each component:

import { DxDataGridTypes } from 'devextreme-vue/data-grid';
import { DxFormTypes } from 'devextreme-vue/form';

const dataGridValidationRule: DxDataGridTypes.ValidationRule;
const formValidationRule: DxFormTypes.ValidationRule;

// In the sample below, ValidationRule is imported from the common submodule:

import { ValidationRule } from 'devextreme-vue/common';

const dataGridValidationRule: ValidationRule;
const formValidationRule: ValidationRule;

0 comments on commit 582204a

Please sign in to comment.