您好,经调研,此处为SpreadJS的设计:
导入Excel文件时,textDecoration默认样式为none,并且超链接drawUnderline的优先级低于单元格textDecoration,所以下划线将不会被显示。
为了解决这个问题:
- sheet.setHyperlink(
- 0,
- 2,
- {
- url: "https://www.grapecity.com/spreadjs",
- tooltip: "baidu",
- linkColor: "blue",
- drawUnderline: true,
- visitedLinkColor: "red",
- target: GC.Spread.Sheets.Hyperlink.HyperlinkTargetType.blank,
- },
- );
- sheet.getCell(0,2).textDecoration(null);
- sheet.setHyperlink(
- 0,
- 1,
- {
- url: "https://www.grapecity.com/spreadjs",
- tooltip: "baidu",
- linkColor: "blue",
- drawUnderline: true,
- visitedLinkColor: "red",
- target: GC.Spread.Sheets.Hyperlink.HyperlinkTargetType.blank,
- },
- GC.Spread.Sheets.SheetArea.viewport
- );
- sheet.getCell(0,1).textDecoration(null);
复制代码
或者:
- var style = sheet.getDefaultStyle();
- delete style.textDecoration;
- sheet.setDefaultStyle(style);
复制代码 |