我正在尝试使用syncfusion删除或禁用超链接。我在编译时没有得到错误。但是,我得到一个运行时错误,内容是“core.mjs:9095ERROR TypeError:无法读取未定义的属性(设置'hyperlinkClick')”
private getSingleTest() {
if (!this.testId) return;
this.testService.getUrl(`get-test-with-file/${this.testId}`)
.subscribe((data) => {
this.test = data.test;
this.initForms(data.test);
if (data.file) {
const base64Url = 'data:application/pdf;base64,' + data.file;
//this.pdfViewer.removeHyperlink();
this.pdfViewer.hyperlinkClick = false;
this.pdfViewer.load(base64Url, '');
}
if (data.test) {
this.onGradeChange(data.test.sectorId)
}
});
}
1条答案
按热度按时间pw9qyyiw1#
要启用或禁用超链接,您可以使用#enablehyperlink API。请参考代码片段和示例。
代码片段:
viewer.enableHyperlink = false;
Angular 样本:https://stackblitz.com/edit/angular-njjwgs?file=src%2Fapp.component.html,src%2Fapp.component.ts,src%2Fapp.component.css
typescript 示例:https://stackblitz.com/edit/gvhkyr?file=index.ts,index.html