尝试使用cropper.js
:
https://github.com/fengyuanchen/cropperjs
https://fengyuanchen.github.io/cropperjs/
下载并解压我index.php
在根级别创建的文件后:
<!doctype html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>IMGED</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<link href="src/index.css" rel="stylesheet">
</head>
<body>
<div>
<img id="image" src="img.jpg" alt='img'>
</div>
<script src="src/index.js"></script>
</body>
</html>
安慰:
Uncaught SyntaxError: Unexpected identifier... index.js:1
index.js
import Cropper from './js/cropper';
export default Cropper;
请问有什么问题吗?