Hi all,
I'm trying to port my Vue2 app to Vue3. Unfortunately I cannot get quick info nested templates to run.
In the Vue2 version of my app I defined the quick info template as follows:
data () {
return {
currentView: 'TimelineWeek',
selectedDate: moment(this.startDate).toDate(),
eventSettings: {
dataSource: dataManager, // ignoreWhitespace: true
},
group: {
enableCompactView: true,
resources: ['Shifts', 'Locations']
},
timeScale: {
enable: false
},
eventTemplate: function (e) { return { template: eventTemplate } },
quickInfoTemplates: {
header: function (e) { return { template: headerTemplate } },
content: function (e) { return { template: contentTemplate } }
}
}
},
Unfortunately this approach won't work in my setup function in Vue3 when using composition API. Can someone please help out?
Many thanks in advance!
|
quickInfoTemplates: {
header: function () {
return {
template: quickHeaderVue,
};
},
content: function () {
return {
template: quickContentVue,
};
},
footer: function () {
return {
template: quickFooterVue,
};
},
}, |
|
var quickHeaderVue = app.component("header", {
template: `<div><div v-if= "data.elementType === 'cell' "><div class="e-cell-header">
<div class="e-header-icon-wrapper"><button class="e-close" title="Close"></button></div></div></div>
<div v-else><div class="e-event-header"><div class="e-header-icon-wrapper"><button class="e-close" title="CLOSE"></button></div></div></div></div>`,
data: () => ({}),
});
var quickContentVue = app.component("content", {
template: `<div><div v-if= "data.elementType === 'cell' "><div class="e-cell-content e-template">
<form class="e-schedule-form"><div><input class="subject e-field" type="text" name="Subject" placeholder="Title"></div><div><input class="location e-field" type="text" name="Location" placeholder="Location"></div></form></div></div><div v-else><div class="e-event-content e-template">
<div class="e-subject-wrap"><div><div v-if="data.Subject !== undefined"><div class="subject">{{data.Subject}}</div></div></div><div><div v-if="data.Location !== undefined"><div class="location">{{data.Location}}</div></div></div><div><div v-if="data.Description !== undefined"><div class="description">{{data.Description}}</div></div></div></div></div></div></div>`,
data: () => ({}),
});
var quickFooterVue = app.component("footer", {
template: `<div><div v-if= "data.elementType === 'cell' "><div class="e-cell-footer">
<button class="e-event-details" title="Extra Details">Extra Details</button>
<button class="e-event-create" title="Add">Add</button></div></div>
<div v-else><div class="e-event-footer"><button class="e-event-edit" title="Edit">Edit</button>
<button class="e-event-delete" title="Delete">Delete</button></div></div></div>`,
data: () => ({}),
}); |
Hi Nevitha,
many thanks! Your solution works perfectly.
Beste regards
Ps.: I have a similar template-based problem with the kanban control. I will open a separate thread.
using "header" and "footer" as component id results in vue warning "Do not use built-in or reserved HTML elements as component id: header"
Hi Bamo,
We tested it by passing the Schedule component id as the header, but it did not throw any warnings. If we misunderstood your requirement, please share the below details to proceed further.
Regards,
Swathi Ravi