luckysheet公式不刷新的问题

MyKai / 2023-09-04 / 原文

luckysheet 表格栏配置了公式,依赖的表格项变动,但是公式依赖栏不刷新。

通过下面的函数,对lucky的数据做处理,增加公式链calcChain参数
官网链接

    handledata (excelData) {
    let data = excelData
    for (const item of data) {
        // 遍历
        let calcChain = [];
        let index = item.index;
        for (const item2 of item.celldata) {
            if (typeof(item2.v.f) !== 'undefined') {
                calcChain.push({
                    r: item2.r,
                    c: item2.c,
                    index,
                })
            }
        }
        item.calcChain = calcChain;
    }