我目前正在使用带有打字稿的 NextJS 我已经插入了脚本:
<Head><link href="/css/bindingbox.min.css" rel="stylesheet"></link><script async type="text/javascript" src="/scripts/annotorious.min.js"></script></Head>
当我试图打电话时:
useEffect(()=>{
setTimeout(() => {
var anno = Annotorious.init({
image: "raven_cafe",
readOnly: true,
});
anno.loadAnnotations('/scripts/annotations.w3c.json');
//disable displaying the binding box when selected on the image
anno.on('selectAnnotation', function(data) {
let element = document.querySelector(`g[data-id="`+data.id+`"]`);
element.classList.remove('selected');
});
}, 100);
},[]);
我收到一个打字稿错误说:“找不到名称'Annotorious'”如何删除该错误?