Dear Syncfusion,
Before migrating to the latest version of Syncfusion and migration to Vue 3, I was able to use a vue component as a column template to avoid using the vue version which includes the compiler. After upgrading, this no longer works. Your documentation is not clear on how to implement a column template from a vue file in Vue 3. Additionally, I could not implement a basic column template using the template string example. Oddly, your documentation says that the "template" prop is string type, but your documentation shows that we are suppose to give a "function" type. Please advise.
with much gratitude,
Carlos
The corresponding composition function:
The parent component pseudo code:
|
module.exports = {
runtimeCompiler: true
}
|
|
<template>
<div id="app">
<ejs-grid :dataSource='data' :allowPaging="true">
<e-columns>
. . . . . . . . .
. . . . . . . . .
<e-column headerText='Employee Image' width='150' textAlign='Center' :template='colTemplate'></e-column>
</e-columns>
</ejs-grid>
</div>
</template>
<script>
import { GridComponent, ColumnsDirective, ColumnDirective, Page } from '@syncfusion/ej2-vue-grids';
import { createApp } from "vue";
const app = createApp();
// Template declaration
var colVue = app.component("colTemplate", {
data: () => ({}),
template: `<b>Name:{{data.OrderID}}</b>`,
});
export default {
name: 'App',
components: {
'ejs-grid' : GridComponent,
'e-columns' : ColumnsDirective,
'e-column' : ColumnDirective
},
data() {
return {
data: [
{
"OrderID":10248,
"CustomerID":"VINET",
"ShipCountry":"France"
},
{
"OrderID":10249,
"CustomerID":"TOMSP",
"ShipCountry":"Germany"
}],
colTemplate: function () {
return { template: colVue };
},
columns: [
{ field: "OrderID", headerText: "OrderID", width: "120" },
{ field: "CustomerID", headerText: "Customer ID", width: "120" },
]
};
},
// module injection
provide: {
grid: [Page],
}
};
</script>
<style>
</style>
|
Dear Syncfusion,
Thank you. I can verify that your sample works with my desired components. However, is there a way to use this feature without including the runtime compiler? If there isn't, can this be supported in a future release?
- Carlos
Dear Syncfusion,
Thank you for your attention to this issue. I was able to get the template functionality working in development, but it does not work in production. I am using Vue CLI 5.0.0-beta2 to build and I'm using a monorepo project with .NET backend. I am currently trying to replicate this issue for you to troubleshoot. I am letting you know in case you run into a similar issue.
Sincerely,
Carlos