本帖最后由 Lynn.Dou 于 2022-8-4 13:58 编辑
有一个简单粗暴的方法,就是将冻结行列的线先设置为透明色,然后依次为这些区域填充边框,下面的代码以 - sheet.frozenRowCount(4);
- sheet.frozenColumnCount(3);
- sheet.frozenTrailingRowCount(1, false);
- sheet.frozenTrailingColumnCount(1, false);
- sheet.options.gridline.showHorizontalGridline = false;
- sheet.options.gridline.showVerticalGridline = false;
复制代码
为基础进行设置。
sheet.options.frozenlineColor = 'rgba(247, 167, 17,0)';//将颜色设置为透明色
let lineBorder1 = new spreadNS.LineBorder('rgb(247, 167, 17)', spreadNS.LineStyle.medium); //设置边框
let range1 = sheet.getRange(0, -1, 4, -1);
let range2 = sheet.getRange(-1, 0, -1, 3);
let range3 = sheet.getRange(sheet.getRowCount()-2, -1, 1, -1);
let range4 = sheet.getRange( -1,sheet.getColumnCount()-2, -1, 1);
range1.setBorder(lineBorder1, { bottom: true });
range2.setBorder(lineBorder1, { right: true }); range3.setBorder(lineBorder1, {bottom: true }); range4.setBorder(lineBorder1, { right: true });
关于边框设置可以参考这个https://demo.grapecity.com.cn/spreadjs/SpreadJSTutorial/features/worksheet/borders-gridlines/vue
|