UNPKG

@syncfusion/ej2-vue-treegrid

Version:
61 lines (60 loc) 1.72 kB
import { gh, isExecute, vueDefineComponent } from '@syncfusion/ej2-vue-base'; import { isNullOrUndefined } from '@syncfusion/ej2-base'; export var ColumnsDirective = 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-columns'; } } }); export var ColumnsPlugin = { name: 'e-columns', install: function (Vue) { Vue.component(ColumnsPlugin.name, ColumnsDirective); } }; /** * `e-column` directive represent a column 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> * </ejs-treegrid> * ``` */ export var ColumnDirective = vueDefineComponent({ render: function () { return; }, methods: { getTag: function () { return 'e-column'; } } }); export var ColumnPlugin = { name: 'e-column', install: function (Vue) { Vue.component(ColumnPlugin.name, ColumnDirective); } };