update: catch

This commit is contained in:
dap 2025-04-05 22:57:52 +08:00
parent 1b2ded7421
commit 0e3eb887da

View File

@ -97,8 +97,12 @@ async function init() {
return; return;
} }
// 访 // 访
const resp = await fetch(props.src); try {
if (resp.status !== 200) { const resp = await fetch(props.src);
if (resp.status !== 200) {
emit('readyError');
}
} catch {
emit('readyError'); emit('readyError');
} }
cropper.value = new Cropper(imgEl, { cropper.value = new Cropper(imgEl, {