Getting Started with the Kendo UI for Vue Native TreeList

This guide provides essential information about using the Kendo UI for Vue Native TreeList package—you will learn how to install the TreeList package, add a TreeList component to your project, style the component, and activate your license.

The TreeList Package is part of Kendo UI for Vue, a professional grade UI library with 100+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

After completing this guide, you will be able to reproduce the following example.

Example
View Source
Change Theme:

Setting Up Your Vue Project

Before you install the Kendo UI for Vue Native TreeView, make sure that you have a running Vue project. The easiest way to set up a Vue project is to use the approach described in the Set up the Vue project section of the First Steps with JavaScript article.

Installing the TreeList Package

All Kendo UI for Vue Native packages are distributed through npm and offer a similar installation experience. To use the TreeList component, start with the installation of the TreeList npm package and its dependencies. Use Node.js v5.0.0 or later.

npm install --save @progress/kendo-vue-treelist @progress/kendo-data-query @progress/kendo-drawing @progress/kendo-date-math @progress/kendo-vue-data-tools @progress/kendo-vue-dateinputs @progress/kendo-vue-dropdowns @progress/kendo-vue-inputs @progress/kendo-vue-intl @progress/kendo-licensing

Importing the Component

After installing the package, in the src/App.vue file of your Vue project, import the TreeList component from the TreeList package.

// ES2015 module syntax
import { TreeList } from "@progress/kendo-vue-treelist";
// CommonJS format
const { TreeList } = require('@progress/kendo-vue-treelist');

Using the Component

  1. Import the data for the TreeList.

      import data from './simple-data';
  2. Define the Native TreeList columns as a data property.

      columns: [
        {
          field: 'name',
          title: 'Name',
          width: '250px',
          expandable: true,
        },
        {
          field: 'title',
          title: 'Title',
        },
      ],
  3. Define a data property with the name of the field that will provide an array representation of the item subitems.

      subItemsField: 'employees',
  4. Define a data property with the name of the field that will provide a Boolean representation of the expanded state of each item.

      expandField: 'expanded',
  5. Add the following TreeView definition in the template section of the src/App.vue file in your project.

      <TreeList
        :style="{
          'max-height': '510px',
          overflow: 'auto',
        }"
        :expand-field="expandField"
        :sub-items-field="subItemsField"
        :data-items="dataItems"
        :columns="columns"
      />
  6. To style the TreeList, install and import the Default theme, which is one of the four beautiful themes for Kendo UI for Vue.

    1. Install the Default theme package.

      npm install --save @progress/kendo-theme-default
    2. Import the Theme package in src/App.vue.

      import '@progress/kendo-theme-default';
  7. Build, run and test the application by typing the following command in the root folder of your project:

    npm run dev

Activating Your License Key

Using any of the UI components in the Kendo UI for Vue Native library requires either a commercial license key or an active trial license key.

Follow the instructions on the My License page to activate your trial or commercial license. You can skip this step if your application already contains a Kendo UI for Vue license file.

Dependencies

The TreeList package requires you to install the following peer dependencies in your application:

Package NameDescription
vue 2.6.11 or 3.0.0Contains the functionality necessary to define Vue components.
@progress/kendo-licensingContains the internal infrastructure related to licensing.
@progress/kendo-svg-iconsContains the SVG icons for the components
@progress/kendo-vue-intlContains the Kendo UI for Vue Native Internationalization package that applies the desired cultures by providing services and pipes for the parsing and formatting of dates and numbers.
@progress/kendo-data-queryApplies sorting, filtering, grouping, and aggregate data operations.
@progress/kendo-vue-animationEnables the animations in the Kendo UI for Vue Native components.
@progress/kendo-vue-data-toolsDelivers components required to manage and control the data in the application.
@progress/kendo-vue-dateinputsContains the Kendo UI for Vue Native Date Inputs components that are used to select the date and time for an appointment.
@progress/kendo-vue-dropdownsContains the Kendo UI for Vue Native Dropdowns, which allows users to choose from a predefined list of options.
@progress/kendo-vue-inputsContains the Kendo UI for Vue Native Inputs, which the input of data, based on a specific and predefined format.
@progress/kendo-drawingContains the Drawing library, which provides interactive vector graphics.
@progress/kendo-vue-buttonsContains the Kendo UI for Vue Native Buttons library, which provides buttons.
@progress/kendo-date-mathContains the logic for working with date objects and timezones.

Vue 2 is currently in its end-of-support phase till Nov 2024. After our last major release for 2024, Vue 2 will no longer be supported in the new versions of the Kendo UI for Vue components. Please check our Vue 2 End of Support article for more details.

Learning Resources