This is a migrated thread and some comments may be shown as answers.

Kendo Vue Window Content template from component

2 Answers 79 Views
This is a migrated thread and some comments may be shown as answers.
Cristiano
Top achievements
Rank 1
Cristiano asked on 30 Oct 2018, 02:39 PM

 Hello,

I'm building a general modal component using the Window. Is it possible to pass a Vue component as template for a kendo Window?

Thanks!

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 01 Nov 2018, 08:28 AM
Hello Cristiano,

On the following CodeSandbox example you can find a simple Window implementation, where a Vue component is used to populate the Window content with data. 

To achieve the desired result, you can define a Vue component(ContentTemplate.vue):
<template>
    <span>
        <button>Get Title</button>
        {{ text }}
    </span>
</template>
 
<script>
export default {
  name: "template1",
  props: {   
    text: String
  }
};
</script>

Then register it in the main.js:
import Template from "./components/ContentTemplate.vue";
Vue.component("my-template", Template);

And finally use this new component withing the Window:
<kendo-window ref="wnd"
     :width="'300px'"
     :title="'Window title'"
     :visible="visible"                 
      style="display:none">
  <my-template :text="content"></my-template>
</kendo-window>

Regards,
Dimitar
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Cristiano
Top achievements
Rank 1
answered on 01 Nov 2018, 01:07 PM
Thanks, @Dimitar!
Asked by
Cristiano
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Cristiano
Top achievements
Rank 1
Share this question
or