欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 时评 > layui-vue第三方库表格列事件怎么写

layui-vue第三方库表格列事件怎么写

2025/4/18 22:33:43 来源:https://blog.csdn.net/everyStudy/article/details/144138862  浏览:    关键词:layui-vue第三方库表格列事件怎么写

插槽写入列点击事件

  <div class="le-table-box" ref="TableBoxRef" :style="{ height: ShowPage ? 'calc(100% - 60px)' : '100%' }"><lay-table @row-double="dbRowClick" :columns="TableColumn" :data-source="TableData" :max-height="tableHeight":rowClassName="RowClassChange" :id="CheckKey" v-model:[TableType]="SelectedKey" @on-select="handleSelect"@row="rowClick" ref="LayTableRef" v-bind="TableConfig"><!-- 通过自定传入插槽实现 --><template #date="{ row, column }"> <span>{{ formatterDate(row[column.key]) }}</span></template><template #image="{ row, column }"><img :src="row[column.key]" alt="" srcset="" @error="imgLoadError"></template><template v-slot:operator="{ row, rowIndex }"><slot name="Controls" :index="rowIndex" :row="row" /></template><template #cell="{ row, column }"> <span @dblclick="dblclickColumnFun(row, column, row[column.key])">{{ row[column.key] }}</span></template></lay-table><div v-if="IsSwitchObj.isShow && TableData.length" class="switch-btn-group":style="{ right: switchRight, top: switchTop }" @click="switchBtnClick"><img v-show="!switchRight" src="@/assets/nav_icon/switch-left.png" alt srcset /><img v-show="switchRight" src="@/assets/nav_icon/switch-right.png" alt srcset /></div></div>
const dblclickColumnFun = (row, column, key) => {emit("DblclickColumEmit", row, column, key);
}
const tableColumn = ref([{title: "点位名称",key: "name",width: "120px",align: "center",ellipsisTooltip: true, // 内容超出隐藏},{title: "编号",key: "indexCode",width: "180px",align: "center",ellipsisTooltip: true,},{title: "违规数",key: "num",width: "180px",align: "center",ellipsisTooltip: true,customSlot:'cell',}, {title: "审核流转数",key: "liuzhuan",width: "180px",align: "center",ellipsisTooltip: true,customSlot:'cell',},{title: "利用率",key: "liyl",width: "180px",align: "center",ellipsisTooltip: true,}
])

row
在这里插入图片描述column
在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词