update dist and lib

This commit is contained in:
jiaming743
2020-08-05 09:59:49 +08:00
parent 32b9757e0f
commit 536ded2964
4 changed files with 43 additions and 13 deletions

View File

@ -4,7 +4,7 @@
<div
class="header-item"
v-for="(headerItem, i) in header"
:key="headerItem + i"
:key="`${headerItem}${i}`"
:style="`
height: ${mergedConfig.headerHeight}px;
line-height: ${mergedConfig.headerHeight}px;
@ -23,7 +23,7 @@
<div
class="row-item"
v-for="(row, ri) in rows"
:key="row.toString() + row.scroll"
:key="`${row.toString()}${row.scroll}`"
:style="`
height: ${heights[ri]}px;
line-height: ${heights[ri]}px;
@ -33,7 +33,7 @@
<div
class="ceil"
v-for="(ceil, ci) in row.ceils"
:key="ceil + ri + ci"
:key="`${ceil}${ri}${ci}`"
:style="`width: ${widths[ci]}px;`"
:align="aligns[ci]"
v-html="ceil"
@ -353,7 +353,7 @@ export default {
let rows = rowsData.slice(animationIndex)
rows.push(...rowsData.slice(0, animationIndex))
this.rows = rows
this.rows = rows.slice(0, rowNum + 1)
this.heights = new Array(rowLength).fill(avgHeight)
await new Promise(resolve => setTimeout(resolve, 300))
@ -387,6 +387,19 @@ export default {
rowIndex,
columnIndex: ci
})
},
updateRows(rows, animationIndex) {
const { mergedConfig, calcRowsData, calcHeights, animationHandler, animation } = this
this.mergedConfig = {
...mergedConfig,
data: [...rows]
}
calcRowsData()
calcHeights()
if (typeof animationIndex === 'number') this.animationIndex = animationIndex
if (!animationHandler) animation(true)
}
},
destroyed () {

View File

@ -208,7 +208,7 @@ export default {
let rows = rowsData.slice(animationIndex)
rows.push(...rowsData.slice(0, animationIndex))
this.rows = rows
this.rows = rows.slice(0, rowNum + 1)
this.heights = new Array(rowLength).fill(avgHeight)
await new Promise(resolve => setTimeout(resolve, 300))