You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just installed cropperjs and made my first example. Out of the Playground section it was not obvious to me how to use the library. Therefore, I suggest to have a "hello world" example being included to the Playground section.
There is also some misleading information. You advice to use a code like this, but it does not work:
<script src="https://unpkg.com/cropperjs"></script>
import Cropper from 'cropperjs';
const cropper = new Cropper('#image');
<img id="image" src="/cropperjs/picture.jpg" alt="Picture">
First, the import statement will lead to an error saying: import declarations may only appear at top level of a module
Then, the "const cropper = new Cropper('#image');" statement is wrong: should be instead "const cropper = new Cropper.default('#image', {});"
Therefore, I would suggest a simple hello world example where everything is put together correctly and is included in the playground section? I think this would help some people to get quicker started on your module.
<!DOCTYPE html>
<html>
<head>
<title>hello world example cropperjs</title>
<script src="https://unpkg.com/cropperjs"></script>
</head>
<body>
<img id="image" src="/cropperjs/picture.jpg" alt="Picture">
<script language="javascript">
const cropper = new Cropper.default('#image', {});
console.log(cropper);
</script>
</body>
</html>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
First, thanks a lot for your contribution!
I just installed cropperjs and made my first example. Out of the Playground section it was not obvious to me how to use the library. Therefore, I suggest to have a "hello world" example being included to the Playground section.
There is also some misleading information. You advice to use a code like this, but it does not work:
First, the import statement will lead to an error saying: import declarations may only appear at top level of a module
Then, the "const cropper = new Cropper('#image');" statement is wrong: should be instead "const cropper = new Cropper.default('#image', {});"
Therefore, I would suggest a simple hello world example where everything is put together correctly and is included in the playground section? I think this would help some people to get quicker started on your module.
Beta Was this translation helpful? Give feedback.
All reactions