当前位置:网站首页>The table component specifies the concatenation parallel method
The table component specifies the concatenation parallel method
2022-07-02 06:46:00 【The health of the bright moon in Qin Dynasty】
majority table Component only provides an abstract method to merge rows or columns , for example element ui Components ,
The parameter interpretation and usage of this method are as follows ,
I can see you ,rowspan Represents the number of rows actually occupied by each row of data ,colspan Represents the number of columns actually occupied by each row of data , We can encapsulate the following methods based on raw data ,
export const getSpanMethodData = (data = [], columns = [ ]) => {
let mergeColumns = {
} // Used to remember the index of data and the number of repetitions when merging columns
let pos = {
} // It is used to record every repetition of the columns that need to be merged , Number of repetitions
columns.forEach(p => {
mergeColumns[p] = []
pos[p] = 0
})
for (let i = 0; i < data.length; i++) {
if (i === 0) {
columns.forEach(p => {
mergeColumns[p].push(1)
pos[p] = 0
})
} else {
columns.forEach((p, index) => {
let obj = {
curr: '',
prev: '',
}
for (let j = 0; j <= index; j++) {
obj.curr += JSON.stringify(data[i][columns[j]])
obj.prev += JSON.stringify(data[i - 1][columns[j]])
}
if (obj.curr === obj.prev) {
mergeColumns[p][pos[p]] += 1
mergeColumns[p].push(0)
} else {
mergeColumns[p].push(1)
pos[p] = i
}
})
}
}
return mergeColumns
}
When executed span-method Method time , You can write like this ,
handleSpan ({
row, column, rowIndex, columnIndex, }) {
if (columnIndex === 0) {
const _row = this.table.spanArr[column.key][rowIndex]
const _col = _row > 0 ? 1 : 0
return {
rowspan: _row,
colspan: _col,
}
}
},
边栏推荐
- web自动中利用win32上传附件
- Latex参考文献引用失败 报错 LaTeX Warning: Citation “*****” on page y undefined on input line *
- 奇葩pip install
- DeprecationWarning: .ix is deprecated. Please use.loc for label based indexing or.iloc for positi
- The intern left a big hole when he ran away and made two online problems, which made me miserable
- Vector types and variables built in CUDA
- Vscode installation, latex environment, parameter configuration, common problem solving
- qq邮箱接收不到jenkins构建后使用email extension 发送的邮件(timestamp 或 auth.......)
- Sublime text configuring PHP compilation environment
- Automation - when Jenkins pipline executes the nodejs command, it prompts node: command not found
猜你喜欢

web自动中利用win32上传附件

Fe - wechat applet - Bluetooth ble development research and use

VSCODE 安装LATEX环境,参数配置,常见问题解决

Idea announced a new default UI, which is too refreshing (including the application link)

Latex compilation error I found no \bibstyle &\bibdata &\citation command

如何调试微信内置浏览器应用(企业号、公众号、订阅号)

Présence d'une panne de courant anormale; Problème de gestion de la fsck d'exécution résolu

Detailed definition of tensorrt data format

Sublime text configuring PHP compilation environment

Linux MySQL 5.6.51 community generic installation tutorial
随机推荐
Latex warning: citation "*****" on page y undefined on input line*
Eggjs -typeorm treeenity practice
qq邮箱接收不到jenkins构建后使用email extension 发送的邮件(timestamp 或 auth.......)
华为MindSpore开源实习机试题
selenium备忘录:selenium\webdriver\remote\remote_connection.py:374: ResourceWarning: unclosed<xxxx>解决办法
Flask-Migrate 检测不到db.string() 等长度变化
Kotlin - verify whether the time format is yyyy MM DD hh:mm:ss
Win10网络图标消失,网络图标变成灰色,打开网络设置闪退等问题解决
PIP install
(第一百篇BLOG)写于博士二年级结束-20200818
There is no way to drag the win10 desktop icon (you can select it, open it, delete it, create it, etc., but you can't drag it)
Name six schemes to realize delayed messages at one go
Function execution space specifier in CUDA
Storage space modifier in CUDA
selenium+msedgedriver+edge浏览器安装驱动的坑
Promise中有resolve和无resolve的代码执行顺序
Win10:添加或者删除开机启动项,在开机启动项中添加在用户自定义的启动文件
ZZQ的博客目录--更新于20210601
20201002 VS 2019 QT5.14 开发的程序打包
Redis - big key problem