Getting Started with KendoVue Popup

The KendoVue Popup positions a piece of content next to a specific anchor component.

The KendoVue Popup component is part of the KendoVue library of Vue UI components. It is distributed through NPM under the kendo-vue-popup package.

Basic Usage

The following example demonstrates the Popup in action.

<style>
  .popup-content {
    padding: 30px;
    color: #787878;
    background-color: #fcf7f8;
    border: 1px solid rgba(0,0,0,.05);
  }
</style>
<div id="vueapp" class="vue-app">
    <div>
        <button
            class="k-button"
            @click="onClick"
            ref="button"
        >
            {{buttonText}}
        </button>
        <Popup
            :anchor="'button'"
            :show="show"
            :popup-class="'popup-content'"
        >
            Popup content.
        </Popup>
    </div>
</div>
import { Popup } from '@progress/kendo-vue-popup';
Vue.component('Popup', Popup);

new Vue({
    el: '#vueapp',
    data: function(){
        return {
            show: false
        };
    },
    computed: {
        buttonText: function(){
            return this.show ? 'Hide' : 'Show';
        }
    },
    mounted(){
        this.show= true;
    },
    methods: {
         onClick () {
            this.show = !this.show;
        }
    }
});

Functionality and Features

Installation

To initialize the Popup, either:

Using CDN

You need to reference the popup package, in order to be able to use the Kendo Native Popup for Vue.

<script src="https://unpkg.com/@progress/kendo-vue-popup@latest/dist/cdn/js/kendo-vue-popup.js"></script>

Initializing with Webpack

  1. Download and install the package. Use Node.js v5.0.0 or later.

    npm install --save @progress/kendo-vue-popup
  2. Once installed, import the package module.

    // ES2015 module syntax
    import { Popup } from '@progress/kendo-vue-popup';
    // CommonJS format
    const { Popup } = require('@progress/kendo-vue-popup');
  3. You are required to install one of the Kendo UI themes to style your components. For more information on how to add the styles, refer to the article on getting started.

Dependencies

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

  • vue 2.6.11*
  • vue-class-component 7.2.2*

In this article