Vue LoadPanel - Show on Page Load
To display a LoadPanel on page load, initialize the component with visible set to true. You can hide the LoadPanel once your page or data finishes loading. The following code snippet demonstrates how to hide the component after ODataStore finishes loading data:
App.vue
- <template>
- <DxLoadPanel
- :visible="loadingVisible"
- shading-color="rgba(0,0,0,0.4)"
- />
- </template>
- <script setup lang="ts">
- import { DxLoadPanel } from 'devextreme-vue/load-panel';
- import ODataStore from 'devextreme/data/odata/store';
- const loadingVisible = ref(true);
- const data: ODataStore = new ODataStore({
- url: "https://js.devexpress.com/Demos/DevAV/odata/Products"
- });
- data.load().then(() => {
- loadingVisible.value = false;
- });
- </script>