DevExtreme Vue - DataSource - store
Configures the store underlying the DataSource.
This property accepts one of the following:
Store instance
An ArrayStore, LocalStore, ODataStore, or CustomStore instance.Store configuration object
An ArrayStore, LocalStore, or ODataStore configuration object. Make sure to set the type property.Array
Assigning an array to the store property automatically creates an ArrayStore in the DataSource.
- <script>
- import DataSource from 'devextreme/data/data_source';
- import ArrayStore from 'devextreme/data/array_store';
- const ds = new DataSource({
- store: new ArrayStore({
- // ArrayStore instance
- })
- // ===== or =====
- store: {
- type: 'array',
- // ArrayStore configuration object
- }
- // ===== or =====
- store: [
- { id: 1, name: 'John Doe' }
- ]
- });
- export default {
- // ...
- data() {
- return {
- ds
- }
- }
- }
- </script>
type
Specifies the storage type the DataSource uses.
This property accepts one of the following values:
"array"
Creates an ArrayStore."local"
Creates a LocalStore."odata"
Creates an ODataStore.
Each store has properties that are detailed in the links above. Declare these properties in the store object.
You can implement custom data access logic as described in the Custom Sources topic if these stores are not suitable.