diff --git a/demos/Basic.tsx b/demos/Basic.tsx index 71b0c9c004ab04827692c6cd89ce178b88d962e5..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/demos/Basic.tsx +++ b/demos/Basic.tsx @@ -1,51 +0,0 @@ -import React, { useRef } from 'react'; -import { Editor } from 'tiny-image-editor'; -import image from './basic.jpg'; -// - - -const Demo = () => { - const EditorRefID =useRef(null); -setTimeout(()=>{ - console.log(`dddd`,EditorRefID); - const handleUpload = EditorRefID?.current?.uploadRef?.current?.handleUpload; - - handleUpload('https://erp-new.cdn.yingtaoyun.com/flw/1784/Q2406170015/jx/1241858/TY990010.jpg!w320') - -},1000) -setTimeout(()=>{ - - const handleUpload = EditorRefID?.current?.uploadRef?.current?.handleUpload; - - const xhr = new XMLHttpRequest(); - // 要请求的 URL - const url = 'https://vercel-api.fivecc.cn/api/annotation'; - xhr.open('GET', url, true); - - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (xhr.status === 200) { - const responseData = JSON.parse(xhr.responseText); - console.log(`asd`,responseData) - - Object.keys(responseData.data).forEach((k)=>{ - let itemObj = responseData.data[k] - handleUpload(itemObj.imgUrl,itemObj) - }) - } else { - resultDiv.textContent = `Error: ${xhr.status}`; - } - } - }; - - xhr.send(); - -},6000) - return ( -
- -
- ); -}; - -export default Demo;