我正在尝试在本地主机上初始化 tui-image-editor。我从https://github.com/nhn/tui.image-editor下载了这个著名的图像编辑器
这是我的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TUI Image Editor</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/2.7.0/fabric.js"></script>
<script type="text/javascript" src="https://uicdn.toast.com/tui.code-snippet/v1.5.0/tui-code-snippet.min.js"></script>
<link rel="stylesheet" href="http://localhost/imageEditor/dist/tui-image-editor.css">
<script src="http://localhost/imageEditor/dist/tui-image-editor.js"></script>
<script>
var ImageEditor = require('tui-image-editor');
var instance = new ImageEditor(document.querySelector('#tui-image-editor'), {
includeUI: {
loadImage: {
path: 'jp.jpg',
name: 'SampleImage'
},
theme: blackTheme, // or whiteTheme
initMenu: 'filter',
menuBarPosition: 'bottom'
},
cssMaxWidth: 700,
cssMaxHeight: 500,
selectionStyle: {
cornerSize: 20,
rotatingPointOffset: 70
}
});
</script>
</head>
<body>
<div id="tui-image-editor" style="height: 200px">
<canvas></canvas>
</div>
</body>
</html>
结果,我得到空白页,没有错误没有警告
我没有摆脱这种情况,你能找出我做错的地方吗?