@syncfusion/ej2-vue-treegrid
Version:
Essential JS 2 TreeGrid Component for Vue
68 lines (67 loc) • 1.94 kB
JavaScript
import { gh, isExecute, vueDefineComponent } from '@syncfusion/ej2-vue-base';
import { isNullOrUndefined } from '@syncfusion/ej2-base';
export var AggregatesDirective = vueDefineComponent({
inject: { custom: { default: null } },
render: function (createElement) {
if (!isExecute) {
var h = !isExecute ? gh : createElement;
var slots = null;
if (!isNullOrUndefined(this.$slots.default)) {
slots = !isExecute ? this.$slots.default() : this.$slots.default;
}
return h('div', { class: 'e-directive' }, slots);
}
return;
},
updated: function () {
if (!isExecute && this.custom) {
this.custom();
}
},
methods: {
getTag: function () {
return 'e-aggregates';
}
}
});
export var AggregatesPlugin = {
name: 'e-aggregates',
install: function (Vue) {
Vue.component(AggregatesPlugin.name, AggregatesDirective);
}
};
/**
* `e-aggregate` directive represent a aggregate row of the VueJS TreeGrid.
* It must be contained in a TreeGrid component(`ejs-treegrid`).
* ```vue
* <ejs-treegrid :dataSource]='data' allowPaging='true' allowSorting='true'>
* <e-columns>
* <e-column field='ID' width='100'/>
* <e-column field='name' headerText='Name' width='100'/>
* </e-columns>
* <e-aggregates>
* <e-aggregate>
* <e-columns>
* <e-column field='ID' type='Min'/>
* </e-columns>
* </e-aggregate>
* </e-aggregates>
* </ejs-treegrid>
* ```
*/
export var AggregateDirective = vueDefineComponent({
render: function () {
return;
},
methods: {
getTag: function () {
return 'e-aggregate';
}
}
});
export var AggregatePlugin = {
name: 'e-aggregate',
install: function (Vue) {
Vue.component(AggregatePlugin.name, AggregateDirective);
}
};