我正在尝试在和中使用TUI编辑器。ejs template
nodejs
我只是按照指南进行的。
- 加
css CDN
在头上。 - 创造
<div id="editor"></div>
<script> CDN
在下面添加<div>
- 制作
instance
问题是什么?html
使用not也会出现同样的问题ejs
。我要疯了。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<!-- TUI editor -->
<!-- <link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor.css" /> -->
<link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor.min.css" />
<!-- axios -->
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
<div class="box write-box shadow">
<div id="editor"></div>
<!-- TUI editor -->
<script src="https://uicdn.toast.com/editor/latest/toastui-editor-all.min.js"></script>
</div>
<!-- scripts -->
<script>
const editor = toastui.Editor({
el: document.querySelector('#editor'),
});
editor.getMarkdown();
</script>
<script src="scripts/app.js"></script>
</body>
</html>