cropper.js-意外标识符

时间:2019-04-20 02:50:25

标签: javascript cropper

尝试使用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;

怎么了,请问

0 个答案:

没有答案