From 641b36da7a654b2a296c4b7340653ef52ac6e86e Mon Sep 17 00:00:00 2001 From: filipKovachev Date: Tue, 6 Aug 2024 19:56:19 +0300 Subject: [PATCH] modify steps and code snippets --- docs/getting-started/get-started-nuxt-3.md | 83 ++++++++-- .../typescript-composition-api.md | 101 ++++++++++--- .../getting-started/typescript-options-api.md | 143 +++++++++++------- 3 files changed, 239 insertions(+), 88 deletions(-) diff --git a/docs/getting-started/get-started-nuxt-3.md b/docs/getting-started/get-started-nuxt-3.md index cb21a48..d70b1e3 100644 --- a/docs/getting-started/get-started-nuxt-3.md +++ b/docs/getting-started/get-started-nuxt-3.md @@ -72,6 +72,7 @@ Kendo UI for Vue includes [four artfully designed themes](slug:themesandstyles) import '@progress/kendo-theme-default/dist/all.css'; ``` +To add any custom styles to your app, insert a `` tag in the `src/App.vue` file and place your styles there. ## Add a Vue Data Grid Component @@ -81,7 +82,7 @@ Kendo UI for Vue includes [four artfully designed themes](slug:themesandstyles) npx nuxi add page KendoGrid ``` -1. In the `pages/KendoGrid.vue` file, add a ` + + + ``` + +This sample code lets you run an application with a very basic Grid: + +1. Execute the `npm run dev` command. +1. Navigate to the local URL displayed in the terminal. > Notice the `No valid license found` message and the watermark in the Grid. They are informational and encourage you to activate your trial or commercial license and to [add a license file to your application](slug:my_license_vue). Once you complete these licensing steps, the license message and the watermark will disappear. ## Configure the Vue Data Grid +Now that you have a running Grid, you are ready to use some of its basic features like sorting and paging. + 1. In the Grid declaration, add [paging](slug:paging_grid), [sorting](slug:sorting_grid), and a height style that activates [scrolling](slug:scrollmmodes_grid). ```html @@ -173,7 +205,7 @@ These steps let you render a very basic Grid by running `npm run dev` and naviga ``` -1. Set the initial `dataState` in the `onMounted` hook and handle the `dataStateChange` event. Implement a `createAppState` helper method that will update the component's state based on the grid's current data state (`skip`, `take`, `sort`): +1. Inside the `onMounted` set the initial `dataState`. This allows the Grid to have the processed data ready for displaying when rendered for the first time. ```js + + + ``` + +1. Re-define the Grid declaration to allow paging and sorting: + + * Set Grid data to `data-items="dataResult"`—With paging enabled, the `data` option must contain only the items for the current page. + * Set the `pageable` and `sortable` props. + * Set the `skip`, `take`, and `sort` props that configure paging and sorting. + * Bind the `@datastatechange` event of the Grid to the `dataStateChange` method to handle the user interactions. + + ```html ``` -1. Set the initial `dataState` in the `setup` function and handle the `dataStateChange` event. Implement a `createAppState` helper method that will update the component's state based on the grid's current data state (`skip`, `take`, `sort`): +1. Set the initial `dataState` in the `onMounted` hook. This allows the Grid to have the processed data ready for displaying when rendered for the first time. ```js + ``` + + +1. Inside the `setup` method handle the `dataStateChange` event and implement a `createAppState` helper method: + * The `dataStateChange` event is triggered when the user interacts with the Grid and calls the `createAppState` helper method. + * The `createAppState` helper method will update the component's state based on the Grid's current data state (`skip`, `take`, `sort`). + * The `dataResult` is updated with the newly processed data and causes the Grid to re-render and display the data according to the new state. + + ```js + + ``` + +1. Re-define the Grid declaration to allow paging and sorting: + + * Set Grid data to `data-items="dataResult"`—With paging enabled, the `data` option must contain only the items for the current page. + * Set the `pageable` and `sortable` props. + * Set the `skip`, `take`, and `sort` props that configure paging and sorting. + * Bind the `@datastatechange` event of the Grid to the `dataStateChange` method to handle the user interactions. + + ```html