Skip to content

Commit 2892143

Browse files
committed
Address comments from review
1 parent e8932c2 commit 2892143

File tree

1 file changed

+31
-51
lines changed

1 file changed

+31
-51
lines changed

docs/getting-started/index.md

Lines changed: 31 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Now that the project is clean, you can start developing the sample application.
7474

7575
## Add Application Data
7676

77-
Components like the Grid need some data that the can display, so, in this step, you will add a file with sample data:
77+
Components like the Grid need some data that they can display, so, in this step, you will add a file with sample data:
7878

7979
1. In the `src` folder, create a new folder called `appdata` where you will place the JSON file with the data.
8080

@@ -143,31 +143,34 @@ Now that you've installed all required packages, you are ready to add the Kendo
143143
</template>
144144
```
145145
146-
1. Define the Grid in the `<script>` block. Add user-friendly [column titles](slug:api_grid_gridcolumnprops#toc-title) by using the `title` property:
146+
1. Define the Grid in the `<script setup>` configuration. Add user-friendly [column titles](slug:api_grid_gridcolumnprops#toc-title) by using the `title` property:
147147
148148
```js
149-
export default defineComponent({
150-
components: {
151-
'grid': Grid,
152-
},
153-
setup() {
154-
const products = productsData;
155-
const columns = [
156-
{ field: 'ProductName', title: 'Product Name' },
157-
{ field: 'UnitPrice', title: 'Price' },
158-
{ field: 'UnitsInStock', title: 'Units in Stock' },
159-
{ field: 'Discontinued' }
160-
];
161-
}
162-
return {
163-
products, columns,
149+
<script setup>
150+
import { ref, onMounted } from 'vue'
151+
152+
// reactive state
153+
const count = ref(0)
154+
155+
// functions that mutate state and trigger updates
156+
function increment() {
157+
count.value++
164158
}
159+
160+
// lifecycle hooks
161+
onMounted(() => {
162+
console.log(`The initial count is ${count.value}.`)
165163
})
164+
</script>
165+
166+
<template>
167+
<button @click="increment">Count is: {{ count }}</button>
168+
</template>
166169
```
167170
168171
These steps let you render a very basic Grid by running `npm run dev` and navigating to the local URL displayed in the terminal.
169172
170-
> Notice the `No valid license found` message and the watermark in the Grid. They are information 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 add a valid license file, the license message and the watermark will disappear.
173+
> 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.
171174
172175
## Configure the Vue Data Grid
173176
@@ -193,40 +196,17 @@ Now that you have a running Grid, you are ready to use some of its basic feature
193196
* Set the initial [`skip`](slug:api_grid_gridprops#toc-skip) for the paging.
194197
* Set the initial [sorting](slug:api_grid_gridprops#toc-sort) by Product name.
195198
196-
```js
197-
<script>
198-
import { ref, defineComponent } from 'vue';
199-
import productsData from './appdata/products.json';
200-
import { Grid } from '@progress/kendo-vue-grid';
201-
import '@progress/kendo-theme-default/dist/all.css';
202-
203-
export default defineComponent({
204-
components: {
205-
'grid': Grid,
206-
},
207-
setup() {
208-
const products = productsData;
209-
const pageable = ref(true);
210-
const sortable = ref(true);
211-
const skip = ref(0);
212-
const take = ref(10);
213-
const sort = ref([
214-
{ field: "ProductName", dir: "asc" }
215-
]);
216-
217-
const columns = [
218-
{ field: 'ProductName', title: 'Product Name' },
219-
{ field: 'UnitPrice', title: 'Price' },
220-
{ field: 'UnitsInStock', title: 'Units in Stock' },
221-
{ field: 'Discontinued' }
222-
];
223-
224-
return {
225-
products, columns, pageable, sortable, skip, take, sort,
226-
}
227-
}
228-
});
199+
```js
200+
<script setup>
201+
import { ref, onMounted } from 'vue'
202+
203+
// placeholder
204+
229205
</script>
206+
207+
<template>
208+
// placeholder
209+
</template>
230210
```
231211
232212
## Get the Complete Source Code

0 commit comments

Comments
 (0)