当前位置: 首页 > news >正文

冯站长之家官网网站开发的学习

冯站长之家官网,网站开发的学习,网站建设开发感想,国内跨境电商平台排行榜前十名注意添加这个属性,会影响到有多少个层级的表头: :header-height“[50, 40]”,即后面的columnIndex 如果有fix的列CustomizedHeader会被调用多次,如果有多个层级的表头,也会被调用多次, 实际被调用次数是(fix数 1 * 表头层级数量) 以下代码均删除了JSX TS版本代码 templ…注意添加这个属性,会影响到有多少个层级的表头: :header-height“[50, 40]”,即后面的columnIndex 如果有fix的列CustomizedHeader会被调用多次,如果有多个层级的表头,也会被调用多次, 实际被调用次数是(fix数 1 * 表头层级数量) 以下代码均删除了JSX TS版本代码 templatediv stylewidth: 100%;height: calc(100vh - 84px)el-auto-resizertemplate #default{ height, width }el-table-v2fixed:columnscolumns:datadata:sort-bysortBy:header-height[50, 40]:header-classheaderClasscolumn-sortonSort:widthwidth:heightheighttemplate #headerpropscustomized-header v-bindprops/customized-header/template/el-table-v2/template/el-auto-resizer/div /templatescript langts setup import {h, ref} from vue import {TableV2FixedDir, TableV2Placeholder, TableV2SortOrder} from element-plus import type {HeaderClassNameGetter,TableV2CustomizedHeaderSlotParam, } from element-plus import type {SortBy} from element-plus// 生成带二级表头的 columns function generateColumns(length 10, prefix column-, props?: any) {return Array.from({length}).map((_, columnIndex) ({...props,key: ${prefix}${columnIndex},dataKey: ${prefix}${columnIndex},title: Column ${columnIndex},width: 150,})) }function generateData(columns: ReturnTypetypeof generateColumns,length 200,prefix row- ) {return Array.from({ length }).map((_, rowIndex) {return columns.reduce((rowData, column, columnIndex) {rowData[column.dataKey] Row ${rowIndex} - Col ${columnIndex}return rowData},{id: ${prefix}${rowIndex},parentId: null,})}) }function CustomizedHeader({cells, columns, headerIndex}) {if (headerIndex 1) return cellsconst groupCells []let width 0let idx 0columns.forEach((column, columnIndex) {if (column.placeholderSign TableV2Placeholder) {groupCells.push(cells[columnIndex])} else {width cells[columnIndex].props.column.widthidxconst nextColumn columns[columnIndex 1]if (columnIndex columns.length - 1 ||nextColumn?.placeholderSign TableV2Placeholder ||idx (headerIndex 0 ? 4 : 2)) {groupCells.push(h(div,{class: flex items-center justify-center custom-header-cell,role: columnheader,style: {...cells[columnIndex].props.style,width: ${width}px,border: 2px solid #fff}},Group width ${width}))width 0idx 0}}})return groupCells; }const headerClass ({headerIndex,}: ParametersHeaderClassNameGetterany[0]) {if (headerIndex 0) return el-primary-colorreturn }const columns generateColumns(70) let data generateData(columns, 20)columns[0].fixed TableV2FixedDir.LEFTfor (let i 0; i 3; i) columns[i].sortable trueconst sortBy refSortBy({key: column-0,order: TableV2SortOrder.ASC, })const onSort (_sortBy: SortBy) {data data.reverse()sortBy.value _sortBy } /scriptstyle .el-el-table-v2__header-row .custom-header-cell {border-right: 1px solid var(--el-border-color); }.el-el-table-v2__header-row .custom-header-cell:last-child {border-right: none; }.el-primary-color {background-color: var(--el-color-primary);color: var(--el-color-white);font-size: 14px;font-weight: bold; }.el-primary-color .custom-header-cell {padding: 0 4px; } /styleJS版本 templatediv stylewidth: 100%;height: calc(100vh - 84px)el-auto-resizertemplate #default{ height, width }el-table-v2fixed:columnscolumns:datadata:sort-bysortBy:header-height[50, 40]:header-classheaderClasscolumn-sortonSort:widthwidth:heightheighttemplate #headerpropsCustomizedHeader v-bindprops/CustomizedHeader/template/el-table-v2/template/el-auto-resizer/div /templatescript setup import { h, ref } from vue import {TableV2FixedDir,TableV2Placeholder,TableV2SortOrder } from element-plus// 生成带二级表头的 columns function generateColumns(length 10, prefix column-) {return Array.from({ length }).map((_, columnIndex) ({key: ${prefix}${columnIndex},dataKey: ${prefix}${columnIndex},title: Column ${columnIndex},width: 150})) }function generateData(columns, length 200, prefix row-) {return Array.from({ length }).map((_, rowIndex) {return columns.reduce((rowData, column, columnIndex) {rowData[column.dataKey] Row ${rowIndex} - Col ${columnIndex}return rowData},{id: ${prefix}${rowIndex},parentId: null})}) }function CustomizedHeader({ cells, columns, headerIndex }) {if (headerIndex 1) return cellsconst groupCells []let width 0let idx 0columns.forEach((column, columnIndex) {if (column.placeholderSign TableV2Placeholder) {groupCells.push(cells[columnIndex])} else {width cells[columnIndex].props.column.widthidxconst nextColumn columns[columnIndex 1]if (columnIndex columns.length - 1 ||nextColumn?.placeholderSign TableV2Placeholder ||idx (headerIndex 0 ? 4 : 2)) {groupCells.push(h(div,{class: flex items-center justify-center custom-header-cell,role: columnheader,style: {...cells[columnIndex].props.style,width: ${width}px,border: 2px solid #fff}},Group width ${width}))width 0idx 0}}})return groupCells }const headerClass ({ headerIndex }) {return headerIndex 0 ? el-primary-color : }const columns generateColumns(70) let data generateData(columns, 20)columns[0].fixed TableV2FixedDir.LEFTfor (let i 0; i 3; i) {columns[i].sortable true }const sortBy ref({key: column-0,order: TableV2SortOrder.ASC })const onSort (_sortBy) {// 创建新数组以保持响应性data [...data].reverse()sortBy.value _sortBy }/scriptstyle .el-el-table-v2__header-row .custom-header-cell {border-right: 1px solid var(--el-border-color); }.el-el-table-v2__header-row .custom-header-cell:last-child {border-right: none; }.el-primary-color {background-color: var(--el-color-primary);color: var(--el-color-white);font-size: 14px;font-weight: bold; }.el-primary-color .custom-header-cell {padding: 0 4px; } /style
http://www.pierceye.com/news/283291/

相关文章:

  • 销售网站模板a5站长网网站交易
  • 网站需要怎么做的吗做营销网站那个好
  • 苏州网站建设软件收费广东网站设计哪家专业
  • 中国产品网免费网站网站自定义功能实现
  • 做微信小程序和做网站短视频素材下载网站
  • 自治区住房和城乡建设厅网站自己怎么健网站视频教程
  • 昆明建站网址dw怎么做秋季运动会网站
  • 为什么要建设个人网站在建工程
  • o2o网站设计方案做一个网站只做前端怎么做
  • 长沙网站建设公司联系方式网站注册手机号安全吗
  • 广州市网站建设服务机构建设部网站查资质
  • 医院网站建设思路wordpress mx主题
  • 天津如何做百度的网站虚拟机做局域网网站服务器
  • 网站建设维护需要懂哪些知识网站建设优质公司
  • 怎么做网络彩票网站校园网站建设经费申请报告
  • 廊坊公司做网站一般网站图标是用什么做的
  • php网站开发文档模板玖壹购网站是做啥子的
  • 海报模板网站有哪些小程序电商平台排名
  • 百度一下百度网站苏州优秀网站设计企业
  • 通信管理局网站备案cms网站建设的实训总结
  • 西安知名网站建设公司百度网页版微信
  • 单纯python能完成网站开发吗门户网站衰落的原因
  • 唐山微网站建设价格宁波外贸网站推广优化
  • 如何能把网站做的更大赤峰网站建设赤峰
  • 织梦大气绿色大气农业能源化工机械产品企业网站源码模版网站设计是用ps做图吗
  • 长沙建设网站公司浙江网站建设上市公司
  • 成都艾邦视觉专业网站建设公司有内涵大气的公司名字
  • 制作学校网站编程基础知识大全
  • 建设银行网站买手机阿里云已备案域名购买
  • 12个优秀的平面设计素材网站wordpress 标题 拼音