提问人:coding life 提问时间:6/26/2023 更新时间:6/26/2023 访问量:341
作为 ES6 模块导入时,无法在 angular 应用程序中使用 DOMPurify.sanitize
Not able to use DOMPurify.sanitize in angular application, when imported as an ES6 module
问:
我正在尝试在我的 angular 应用程序中使用 dompurify,在服务中。我将其导入为
import * as DOMPurify from 'dompurify';
当作为 CSR 应用程序正常运行时,这工作正常。但是如果我将它作为 SSR 运行,我会得到
export 'sanitize' (导入为 'DOMPurify') 在 “dompurify”(可能的导出:默认)
我正在使用 dompurify v3.0.3。另一方面,如果我使用
const DOMPurify = require('dompurify')
它工作没有错误。但我不确定这是否是使用它的正确方法,因为 angular 建议使用 ES6 导入。
答: 暂无答案
评论