You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
page_title: Kendo UI for Vue Components Introduction - Kendo UI for Vue Docs & Demos
4
-
description: "Get started with the Kendo UI for Vue Native Components using Vite and Composition API."
2
+
title: First Steps (Composition API and JavaScript)
3
+
page_title: Get Started with Kendo UI for Vue - Kendo UI for Vue Docs & Demos
4
+
description: "Get started with the Kendo UI for Vue Native Components and build your first Data Grid by using Vite and the Composition API."
5
5
slug: getting_started_javascript_composition_api
6
6
brand: getting-started
7
7
heading: Get Started
@@ -10,7 +10,7 @@ position: 0
10
10
11
11
# Get Started with Kendo UI for Vue
12
12
13
-
This tutorial will help you develop a simple app that includes a few native Vue components: *[Grid]*, *[Component2]*, and *[Component3]*. To achieve this, you will build a project using [Vite](https://vitejs.dev/) and the [Vue Composition API](https://vuejs.org/guide/introduction.html#composition-api) paired with JavaScript.
13
+
This tutorial will help you develop a simple app that includes a native Vue Data Grid component. To achieve this, you will build a project using [Vite](https://vitejs.dev/) and the [Vue Composition API](https://vuejs.org/guide/introduction.html#composition-api) paired with JavaScript.
14
14
15
15
>Curious about TypeScript or the Options API? This tutorial comes in several additional variants:
16
16
>*[Kendo UI for Vue with TypeScript and the Composition API](slug:getting_started_typescript_composition_api)
@@ -66,161 +66,64 @@ The recommended way to scaffold your Vue project is using [Vite](https://vuejs.o
66
66
67
67
Before you start playing with Kendo UI for Vue, clean up the sample app created by Vite:
68
68
69
-
1. In the `src/components` folder, delete the `HelloWorld.vue` file.
70
-
1. Replace the content of the `src/App.vue` with the following:
69
+
1. Delete the `HelloWorld.vue` file in the `src/components` folder.
70
+
1. Remove everything in the `src/App.vue` file and leave it blank.
71
+
??? 1. Delete the `import './style.css'` line in the `src/main.js` file.
71
72
72
-
```html
73
-
<script setup>
74
-
</script>
75
-
76
-
<template>
77
-
</template>
78
-
79
-
<style scoped>
80
-
</style>
81
-
```
82
-
83
-
Now that the project is blank, you can start developing the sample application.
73
+
Now that the project is clean, you can start developing the sample application.
84
74
85
75
## Add Application Data
86
76
87
77
Components like the Grid need some data that the can display, so, in this step, you will add two files with sample data:
88
78
89
-
1. In the `src` folder, create a new folder called `appdata`.
79
+
1. In the `src` folder, create a new folder called `appdata` where you will place the JSON files with the data.
90
80
91
81
1. Create a new `src/appdata/categories.json` file. Copy the content of [this GitHub file](https://github.com/telerik/kendo-vue/tree/master/getting-started-javascript-composition-api/src/appdata/categories.json) and paste it into the `categories.json` file.
92
82
93
83
1. Create a new `src/appdata/products.json` file. Copy the content of [this GitHub file](https://github.com/telerik/kendo-vue/tree/master/getting-started-javascript-composition-api/src/appdata/products.json) and paste it into the `products.json` file.
94
84
95
-
## 4. Import Kendo UI for Vue components
96
-
97
-
Kendo UI for Vue is distributed as multiple NPM packages, scoped to `@progress`. For example, the name of the Grid package is `@progress/kendo-vue-grid`.
98
-
99
-
Kendo UI for Vue is a rich suite of many modular components. For our dashboard example, we’ll use three of these components: The Grid, the DropDownList and the Window.
100
-
101
-
Let’s add the mentioned components’ packages and their dependencies:
With the above, we not only add the packages of the `Grid` and `DropDownList` but also add another important package – `kendo-data-query`. It contains useful functions for client-side data operations.
110
-
111
-
To install the Window component run the following:
Kendo UI for Vue includes four gorgeous themes, which are all available as separate NPM packages. The available theme packages are [@progress/kendo-theme-default](https://www.npmjs.com/package/@progress/kendo-theme-default), [@progress/kendo-theme-bootstrap](https://www.npmjs.com/package/@progress/kendo-theme-bootstrap), [@progress/kendo-theme-material](https://www.npmjs.com/package/@progress/kendo-theme-material) and [@progress/kendo-theme-fluent](https://www.npmjs.com/package/@progress/kendo-theme-fluent).
87
+
Kendo UI forVue is distributed as multiple NPM packages, scoped to `@progress`. For example, the name of the Grid package is `@progress/kendo-vue-grid`. To use the Gridin your app, add the component and its dependencies:
122
88
123
-
Let’s take the Default theme and install it just like we did with the component packages:
Import the CSS files from the package in the `src/App.vue` file. If needed, any additional custom styles can be added in the `<styles>` tag of the `src/App.vue` file.
Now that you have everything set up and ready to go, let’s begin using the Kendo UI for Vue components, starting with the [DropDownList](slug:overview_dropdownlist) component.
142
-
Before we continue, the first thing we should do is to import the already installed DropDownList component into the `src/App.vue` file and the `appdata/categories.json` file using the following code:
143
-
```js
144
-
import { DropDownList } from '@progress/kendo-vue-dropdowns';
145
-
import categories from './appdata/categories.json';
146
-
```
147
-
Add the DropDownList component with the following code:
148
-
```js
149
-
export default defineComponent({
150
-
components: {
151
-
'dropdownlist': DropDownList,
152
-
},
153
-
//..............
154
-
```
155
-
156
-
After importing the component, use the code below to bind a DropDownList to a list of categories.
The data-items property of the DropDownList points to an array of objects or primitive values. In this case, you’re using an array of objects, and therefore specify both `data-item-key` and `text-field` properties.
96
+
--->
166
97
167
-
You can also use the `default-item` property to display a hint forthe users when no item is selected. The default item should have a field that matches the `text-field` name.
98
+
## Import the Kendo UI for Vue CSS Styles
168
99
169
-
To show a little more of the DropDownList in action, update the `src/App.vue` file to use the below code.
170
-
```html
171
-
<template>
172
-
<div id="app">
173
-
<h1>Hello Kendo UI for Vue!</h1>
174
-
<p>
175
-
<dropdownlist
176
-
:data-items="categories"
177
-
:data-item-key="'CategoryID'"
178
-
:text-field="'CategoryName'"
179
-
:default-item="defaultItems"
180
-
@change="handleDropDownChange"
181
-
></dropdownlist> Selected category ID:
182
-
<strong>{{ dropdownlistCategory }}</strong>
183
-
</p>
184
-
</div>
185
-
</template>
100
+
Kendo UI for Vue includes [four artfully designed themes](slug:themesandstyles) available as separate NPM packages. To style the components, you can use each theme as is or [customize](slug:customizingthemes) it to your liking.
186
101
187
-
<script>
188
-
import { ref, defineComponent } from 'vue';
189
-
import { categoriesData } from './appdata/categories';
190
-
import { DropDownList } from '@progress/kendo-vue-dropdowns';
102
+
1. Install the [Default theme](https://www.telerik.com/kendo-vue-ui/components/styling/theme-default/):
The above code additionally renders the ID of the selected category next to the `DropDownList`. You do this by defining a `dropdownlistCategory` field in the data options and implementing an [onChange](slug:api_dropdowns_dropdownlistchangeevent) handler to set it.
114
+
1. In the `src/App.vue` file, import the CSS files provided by the installed theme package:
213
115
214
-
> With the things added above, you can already test the Native DropDownList component. If you need a basic test of the `Kendo UI for Vue Native` suite, you can stop here or continue further with the more complex scenario where the [Grid](slug:overview_grid) and [Window](slug:overview_window) components are used.
You can add any additional custom styles in the `<styles>` tag of the `src/App.vue` file.
217
121
218
-
Now that you’ve seen what a basic Kendo UI for Vue component looks like, let’s next implement something more complex with the Kendo UI for Vue Data Grid.
122
+
## Add a Kendo UI for Vue Data Grid
219
123
220
-
The [Kendo UI for Vue Data Grid](slug:overview_grid) provides 100+ ready-to-use features, covering everything from paging, sorting, filtering, editing and grouping, to row and column virtualization and Excel export.
221
124
In this section you’ll try out several of these features, but let’s start by seeing a simple Grid in action.
222
125
223
-
Import the `Grid` component, the `process` package and the products.json file to the `src/App.vue file`.
126
+
Import the `Grid` component, the `process` package and the `products.json` file to the `src/App.vue file`.
0 commit comments