UNPKG

el-table-virtual-scroll-next

Version:

The virtual scrolling component developed based on the Table component of Element-Plus supports dynamic height and solves the problem of scrolling stuck when the amount of data is large.

2 lines (1 loc) 21.3 kB
var ElTableVirtualScroll=function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){s=!0,i=e}finally{try{if(!c&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(s)throw i}}return a}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var s=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d="object"==typeof u&&u&&u.Object===Object&&u,h="object"==typeof self&&self&&self.Object===Object&&self,f=d||h||Function("return this")(),p=function(){return f.Date.now()},v=/\s/;var m=function(e){for(var t=e.length;t--&&v.test(e.charAt(t)););return t},y=/^\s+/;var b=function(e){return e?e.slice(0,m(e)+1).replace(y,""):e},w=f.Symbol,g=Object.prototype,S=g.hasOwnProperty,k=g.toString,C=w?w.toStringTag:void 0;var _=function(e){var t=S.call(e,C),n=e[C];try{e[C]=void 0;var r=!0}catch(e){}var i=k.call(e);return r&&(t?e[C]=n:delete e[C]),i},T=Object.prototype.toString;var $=function(e){return T.call(e)},x=w?w.toStringTag:void 0;var E=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":x&&x in Object(e)?_(e):$(e)};var B=function(e){return null!=e&&"object"==typeof e};var O=function(e){return"symbol"==typeof e||B(e)&&"[object Symbol]"==E(e)},A=/^[-+]0x[0-9a-f]+$/i,z=/^0b[01]+$/i,N=/^0o[0-7]+$/i,P=parseInt;var j=function(e){if("number"==typeof e)return e;if(O(e))return NaN;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=b(e);var n=z.test(e);return n||N.test(e)?P(e.slice(2),n?2:8):A.test(e)?NaN:+e},D=Math.max,V=Math.min;var R=function(e,t,n){var r,i,o,l,a,c,u=0,d=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=r,o=i;return r=i=void 0,u=t,l=e.apply(o,n)}function m(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-u>=o}function y(){var e=p();if(m(e))return b(e);a=setTimeout(y,function(e){var n=t-(e-c);return h?V(n,o-(e-u)):n}(e))}function b(e){return a=void 0,f&&r?v(e):(r=i=void 0,l)}function w(){var e=p(),n=m(e);if(r=arguments,i=this,c=e,n){if(void 0===a)return function(e){return u=e,a=setTimeout(y,t),d?v(e):l}(c);if(h)return clearTimeout(a),a=setTimeout(y,t),v(c)}return void 0===a&&(a=setTimeout(y,t)),l}return t=j(t)||0,s(n)&&(d=!!n.leading,o=(h="maxWait"in n)?D(j(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),w.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=c=i=a=void 0},w.flush=function(){return void 0===a?l:b(p())},w};var I=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return s(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),R(e,t,{leading:r,maxWait:t,trailing:i})};function L(e){return e===window?window.pageYOffset:e.scrollTop}function M(e){return e===window?window.pageXOffset:e.scrollLeft}function U(e,t){return e===window?window.scroll(window.pageXOffset,t):e.scrollTop=t}function q(e,t){return e===window?window.scroll(t,window.pageYOffset):e.scrollLeft=t}function H(e){return null==e}var F=[".el-table__body-wrapper .el-scrollbar__view"],Y=0,K={inheritAttrs:!1,name:"el-table-virtual-scroll",props:{data:{type:Array,required:!0},itemSize:{type:Number,default:60},scrollBox:{type:String},buffer:{type:Number,default:200},keyProp:{type:String,default:"id"},throttleTime:{type:Number,default:10},dynamic:{type:Boolean,default:!0},virtualized:{type:Boolean,default:!0},rowSpanKey:{type:Function}},provide:function(){return{virtualScroll:this}},data:function(){return{sizes:{},start:0,end:void 0,curRow:null,isExpanding:!1,columnVms:[],isHideAppend:!1,stopAmin:!1}},computed:{offsetMap:function(e){var t=e.keyProp,n=e.itemSize,r=e.sizes,i=e.data;if(!this.dynamic)return{};for(var o={},l=0,a=0;a<i.length;a++){var c=i[a][t];o[c]=l;var s=r[c];l+="number"==typeof s?s:n}return o}},methods:{initData:function(){var e=this;this.renderData=[],this.top=void 0,this.bottom=void 0,this.start=0,this.end=void 0,this.toTop=0,this.isDeactivated=!1,this.scrollPos=[0,0,0,0],this.scroller=this.getScroller(),this.setToTop(),this.recordTablePos(),setTimeout((function(){e.handleScroll()}),100),this.onScroll=this.throttleTime?I(this.handleScroll,this.throttleTime):this.handleScroll,this.scroller.addEventListener("scroll",this.onScroll,{passive:!0}),window.addEventListener("resize",this.onScroll)},getScroller:function(){var e;if(this.scrollBox){if("window"===this.scrollBox||this.scrollBox===window)return window;if(!(e=document.querySelector(this.scrollBox)))throw new Error(" scrollBox prop: '".concat(this.scrollBox,"' is not a valid selector"));return function(e){var t=window.getComputedStyle(e,null),n=["auto","scroll"];return n.includes(t.overflow)||n.includes(t["overflow-y"])}(e)||console.warn("Warning! scrollBox prop: '".concat(this.scrollBox,"' is not a scroll element")),e}return this.innerScroll=!0,this.$el.querySelector(".el-table__body-wrapper .el-scrollbar__wrap")},setToTop:function(){this.innerScroll?this.toTop=0:this.toTop=this.$el.getBoundingClientRect().top-(this.scroller===window?0:this.scroller.getBoundingClientRect().top)+L(this.scroller)},handleScroll:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stopAmin=!0,this.$nextTick((function(){e.stopAmin=!1})),this.isDeactivated||(this.scrollPos[0]=L(this.scroller),this.scrollPos[1]=M(this.scroller),this.virtualized&&(this.updateSizes(),this.calcRenderData(),this.calcPosition(),t&&this.updatePosition(),this.$emit("change",this.renderData,this.start,this.end)))},updateSizes:function(){var e=this;if(this.dynamic){var t=this.$el.querySelectorAll(".el-table__body > tbody > .el-table__row"),n=!1;t[0]&&t[0].classList.contains("el-table__row--level-0")&&(n=!0,t=this.$el.querySelectorAll(".el-table__body > tbody > .el-table__row.el-table__row--level-0")),Array.from(t).forEach((function(t,r){var i=e.renderData[r];if(i){var o=t.offsetHeight,l=t.nextSibling;if("TR"===l.tagName&&l.querySelector(".el-table__expanded-cell")&&(o+=l.offsetHeight),n)for(var a=t.nextSibling;a&&"TR"===a.tagName&&!a.classList.contains("el-table__row--level-0");)o+=a.offsetHeight,a=a.nextSibling;var c=i[e.keyProp];e.sizes[c]!==o&&(e.sizes[c]=o)}}))}},getItemOffsetTop:function(e){if(!this.dynamic)return this.itemSize*e;var t=this.data[e];return t&&this.offsetMap[t[this.keyProp]]||0},getItemSize:function(e){if(e<=-1)return 0;var t=this.data[e];if(t){var n=t[this.keyProp];return this.sizes[n]||this.itemSize}return this.itemSize},calcRenderData:function(){var e,t,n,r=this.scroller,i=this.data,l=this.buffer,a=this.scrollPos[0]-l-this.toTop,c=this.scrollPos[0]+((e=r)===window?window.innerHeight:e.offsetHeight)+l-this.toTop;if(this.dynamic){for(var s=0,u=i.length-1,d=0;s<=u;){if(d=Math.floor((s+u)/2),this.getItemOffsetTop(d)<a){if(this.getItemOffsetTop(d+1)>a)break;s=d+1}else u=d-1}t=d,n=i.length-1;for(var h=t+1;h<i.length;h++){if(this.getItemOffsetTop(h)>=c){n=h;break}}}else t=a<=0?0:Math.floor(a/this.itemSize),n=c<=0?0:Math.ceil(c/this.itemSize);if(this.isRowSpan()){var f=o(this.calcRenderSpanData(t,n),2);t=f[0],n=f[1]}else t%2&&(t-=1);this.top=a,this.bottom=c,this.start=t,this.end=n,this.renderData=i.slice(t,n+1)},calcRenderSpanData:function(e,t){for(var n;e>0;){var r=this.data[e],i=this.rowSpanKey(r,e);if(H(i))break;if(!H(n)&&n!==i){e++;break}n=i,e--}var o=this.data.length;for(n=void 0;t<o;){var l=this.data[t],a=this.rowSpanKey(l,t);if(!a)break;if(n&&n!==a){t--;break}n=a,t++}return[e,t]},isRowSpan:function(){return"function"==typeof this.rowSpanKey},calcPosition:function(){var e=this,t=this.data.length-1,n=this.getItemOffsetTop(t)+this.getItemSize(t),r=this.getItemOffsetTop(this.start);F.forEach((function(t){var i=e.$el.querySelector(t);if(i){if(!i.wrapEl){var o=document.createElement("div"),l=document.createElement("div");o.appendChild(l),l.appendChild(i.children[0]),i.insertBefore(o,i.firstChild),i.wrapEl=o,i.innerEl=l}i.wrapEl&&(i.wrapEl.style.height=n+"px",i.innerEl.style.transform="translateY(".concat(r,"px)"))}}))},updatePosition:function(){var e=this;this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){e.timer&&clearTimeout(e.timer),e.handleScroll(!1)}),this.throttleTime+10)},renderAllData:function(){var e=this;this.renderData=this.data,this.$emit("change",this.data,0,this.data.length-1),this.$nextTick((function(){F.forEach((function(t){var n=e.$el.querySelector(t);n&&n.wrapEl&&(n.wrapEl.style.height="auto",n.innerEl.style.transform="translateY(".concat(0,"px)"))}))}))},update:function(){this.setToTop(),this.handleScroll()},scrollTo:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.data[e]&&this.scroller&&(this.updateSizes(),this.calcRenderData(),this.$nextTick((function(){var r,i,o=t.getItemOffsetTop(e);r=t.scroller,i=o,r===window?window.scroll(0,i):r.scrollTop=i,n||setTimeout((function(){t.scrollTo(e,!0)}),50)})))},reset:function(){this.sizes={},this.scrollTo(0,!1)},addColumn:function(e){this.columnVms.push(e)},removeColumn:function(e){this.columnVms=this.columnVms.filter((function(t){return t!==e}))},checkAll:function(e){var t=this;this.data.forEach((function(n){return t.checkRow(n,e,!1)})),this.emitSelectionChange(),!1===e&&(Y=0)},checkRow:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e.$v_checked!==t&&(e.$v_checked=t,e.$v_checkedOrder=t?Y++:void 0,n&&this.emitSelectionChange())},emitSelectionChange:function(){var e=this.data.filter((function(e){return e.$v_checked})).sort((function(e,t){return e.$v_checkedOrder-t.$v_checkedOrder}));this.$emit("selection-change",e)},clearSelection:function(){this.checkAll(!1),this.columnVms.forEach((function(e){return e.syncCheckStatus()}))},toggleRowSelection:function(e,t){var n="boolean"==typeof t?t:!e.$v_checked;this.checkRow(e,n),this.columnVms.forEach((function(e){return e.syncCheckStatus()}))},setCurrentRow:function(e){this.curRow=e,this.$emit("current-change",e)},updateData:function(e){this.$emit("update:data",e)},doUpdate:function(){var e=this;this.hasDoUpdate||this.scroller&&(this.isHideAppend=!0,this.update(),this.hasDoUpdate=!0,this.$nextTick((function(){e.hasDoUpdate=!1,e.isHideAppend=!1})))},recordTablePos:function(){var e=this;this.innerScroll||this.isDeactivated||(this.tableBodyEl=this.$el.querySelector(".el-table__body-wrapper"),this.onTableScroll=I((function(){e.scrollPos[2]=L(e.tableBodyEl),e.scrollPos[3]=M(e.tableBodyEl)}),100),this.tableBodyEl.addEventListener("scroll",this.onTableScroll,{passive:!0}))},restoreScrollY:function(){var e=this;if(this.scroller){var t=o(this.scrollPos,4),n=t[0],r=t[1],i=t[2],l=t[3];this.innerScroll?setTimeout((function(){U(e.scroller,n),q(e.scroller,r);var t=document.querySelector(F[1]),i=document.querySelector(F[2]);t&&U(t,n),i&&U(i,n)}),50):(U(this.scroller,n),q(this.scroller,r),U(this.tableBodyEl,i),q(this.tableBodyEl,l))}}},watch:{data:function(){this.virtualized?this.doUpdate():this.renderAllData()},"data.length":function(){this.virtualized?this.doUpdate():this.renderAllData()},virtualized:{immediate:!0,handler:function(e){e?this.doUpdate():this.renderAllData()}}},created:function(){var e=this;this.$nextTick((function(){e.initData()}))},beforeUnmount:function(){this.scroller&&(this.scroller.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onScroll))},activated:function(){this.isDeactivated=!1,this.restoreScrollY()},deactivated:function(){this.isDeactivated=!0}};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".hide-append[data-v-6ee4cd4b] [data-v-6ee4cd4b] .el-table__append-wrapper {\n display: none;\n}\n.no-row-amin[data-v-6ee4cd4b] [data-v-6ee4cd4b] .hover-row td.el-table__cell {\n background: inherit !important;\n}\n"),K.render=function(e,n,r,i,o,l){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["el-table-virtual-scroll",[o.isHideAppend?"hide-append":"",o.stopAmin?"no-row-amin":""]])},[t.renderSlot(e.$slots,"default")],2)},K.__scopeId="data-v-6ee4cd4b",K.__file="src/el-table-virtual-scroll.vue";var W={inheritAttrs:!1,name:"el-table-virtual-column",components:{},inject:["virtualScroll"],props:{load:{type:Function},indent:{type:Number,default:16}},data:function(){return{isCheckedAll:!1,isCheckedImn:!1,isTree:!1,type:void 0}},methods:{onCheckAllRows:function(e){e=!!this.isCheckedImn||e,this.virtualScroll.checkAll(e),this.isCheckedAll=e,this.isCheckedImn=!1},onCheckRow:function(e,t){this.virtualScroll.checkRow(e,t),this.syncCheckStatus()},syncCheckStatus:function(){var e=this.virtualScroll.data,t=e.filter((function(e){return!0===e.$v_checked})).length;0===t?(this.isCheckedAll=!1,this.isCheckedImn=!1):t===e.length?(this.isCheckedAll=!0,this.isCheckedImn=!1):(this.isCheckedAll=!1,this.isCheckedImn=!0)},onRadioChange:function(e){this.virtualScroll.setCurrentRow(e)},getIndex:function(e){var t=this.virtualScroll.start+e.$index;return"function"==typeof this.$attrs.index?this.$attrs.index(t):t+1},onTreeNodeExpand:function(e){this.$set(e,"$v_expanded",!e.$v_expanded),e.$v_expanded?this.loadChildNodes(e):this.hideChildNodes(e)},loadChildNodes:function(e){if(e.$v_loaded){var t=this.virtualScroll.data,n=t.findIndex((function(t){return t===e}));n>-1&&this.virtualScroll.updateData([].concat(l(t.slice(0,n+1)),l(e.$v_hideNodes),l(t.slice(n+1))))}else this.$set(e,"$v_loading",!0),this.load&&this.load(e,function(t){Array.isArray(!t)&&(t=[]);this.$set(e,"$v_loading",!1),this.$set(e,"$v_loaded",!0),this.$set(e,"$v_hasChildren",!!t.length),t.forEach((function(t){t.$level="number"==typeof e.$level?e.$level+1:2}));var n=this.virtualScroll.data,r=n.findIndex((function(t){return t===e}));r>-1&&this.virtualScroll.updateData([].concat(l(n.slice(0,r+1)),l(t),l(n.slice(r+1))))}.bind(this))},hideChildNodes:function(e){var t=this.virtualScroll.data,n=t.findIndex((function(t){return t===e}));if(-1!==n){for(var r=[],i=n+1;i<t.length;i++){var o=t[i];if((o.$level||1)<=(e.$level||1))break;r.push(o)}this.$set(e,"$v_hideNodes",r);var l=t.filter((function(e){return!r.includes(e)}));this.virtualScroll.updateData(l),this.virtualScroll.update()}}},created:function(){this.$set=function(e,t,n){e[t]=n},this.virtualScroll.addColumn(this);var e=this.$attrs.type;["index","selection","radio","tree"].includes(e)?this.type="v-"+e:this.type=e,"tree"===e&&(this.isTree=!0)},beforeUnmount:function(){this.virtualScroll.removeColumn(this)}},X=["onClick"],G={key:0,class:"el-icon is-loading"},J=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})],-1)],Q={key:1,class:"el-icon"},Z=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})],-1)],ee={key:1,class:"el-table__placeholder"},te=t.createElementVNode("span",null,null,-1);return W.render=function(e,n,i,o,l,a){var c=t.resolveComponent("el-checkbox"),s=t.resolveComponent("el-radio"),u=t.resolveComponent("el-table-column");return t.openBlock(),t.createBlock(u,t.mergeProps(r(r({},e.$attrs),{},{type:l.type}),{"class-name":l.isTree?"el-table__row--level":""}),{header:t.withCtx((function(r){return[t.renderSlot(e.$slots,"header",t.normalizeProps(t.guardReactiveProps(r)),(function(){return[t.createCommentVNode(" 多选类型-全选 "),"v-selection"===r.column.type?(t.openBlock(),t.createBlock(c,{key:0,modelValue:l.isCheckedAll,"onUpdate:modelValue":n[0]||(n[0]=function(e){return l.isCheckedAll=e}),indeterminate:l.isCheckedImn,onChange:a.onCheckAllRows},null,8,["modelValue","indeterminate","onChange"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(r.column.label),1)],64))]}))]})),default:t.withCtx((function(n){return[t.createCommentVNode(" v-tree类型 "),n.column&&"v-tree"===n.column.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("span",{class:"el-table__indent",style:t.normalizeStyle({paddingLeft:"".concat((n.row.$level-1)*i.indent,"px")})},null,4),!1!==n.row.$v_hasChildren?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["el-table__expand-icon",n.row.$v_expanded?"el-table__expand-icon--expanded":""]),onClick:function(e){return a.onTreeNodeExpand(n.row)}},[n.row.$v_loading?(t.openBlock(),t.createElementBlock("i",G,[].concat(J))):(t.openBlock(),t.createElementBlock("i",Q,[].concat(Z)))],10,X)):(t.openBlock(),t.createElementBlock("span",ee))],64)):t.createCommentVNode("v-if",!0),t.renderSlot(e.$slots,"default",t.normalizeProps(t.guardReactiveProps(n)),(function(){return[t.createCommentVNode(" 多选类型 "),"v-selection"===n.column.type?(t.openBlock(),t.createBlock(c,{key:0,"model-value":n.row.$v_checked,onChange:function(e){return a.onCheckRow(n.row,!n.row.$v_checked)}},null,8,["model-value","onChange"])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" 单选类型 "),"v-radio"===n.column.type?(t.openBlock(),t.createBlock(s,{key:1,label:!0,"model-value":a.virtualScroll.curRow===n.row,onChange:function(e){return a.onRadioChange(n.row)}},{default:t.withCtx((function(){return[te]})),_:2},1032,["model-value","onChange"])):"v-index"===n.column.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createCommentVNode(" v-index类型 "),t.createElementVNode("span",null,t.toDisplayString(a.getIndex(n)),1)],2112)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createCommentVNode(" 支持嵌套 "),t.renderSlot(e.$slots,"default",{},(function(){return[t.createTextVNode(t.toDisplayString(n.row[n.column.property]),1)]}))],64))]}))]})),_:3},16,["class-name"])},W.__file="src/el-table-virtual-column.vue",e.VirtualColumn=W,e.VirtualScroll=K,e.default=K,Object.defineProperty(e,"__esModule",{value:!0}),e}({},vue);