Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 我可以在Spring引导环境中使用ckEditor和Thymeleaf吗? 翻页 书写页_Html_Ckeditor_Thymeleaf - Fatal编程技术网

Html 我可以在Spring引导环境中使用ckEditor和Thymeleaf吗? 翻页 书写页

Html 我可以在Spring引导环境中使用ckEditor和Thymeleaf吗? 翻页 书写页,html,ckeditor,thymeleaf,Html,Ckeditor,Thymeleaf,作者: 标题: 内容: 我这么做了,但没用。所以我尝试了另一种方法 <!DOCTYPE html> <html lang="ko" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="layout/default&

作者:

标题:

内容:

我这么做了,但没用。所以我尝试了另一种方法

<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="layout/default">

<title>Make Page</title>
<script th:inline="javascript" src="https://cdn.ckeditor.com/ckeditor5/27.1.0/classic/ckeditor.js">
</script>

<body layout:fragment="content">
<div style="text-align: center">
<h1>write page</h1>
<form  th:action="@{/createDiary}" th:object="${Diary}" method="post">
    <p>writer : <input type="text" th:field="*{writer}"/></p>
    <p>title : <input type="text" th:field="*{title}"/></p>
    <p>content : <input  style="width: 300px; height: 300px;" type="text" th:field="*{content}"/></p>
    <p><input type="submit" value="add"/> <input type="reset" value="reset"/></p>
</form>
</div>
</body>
</html>


改为

<script th:inline="javascript" src="https://cdn.ckeditor.com/ckeditor5/27.1.0/classic/ckeditor.js">
</script>

我还是看不见。我做错了什么

是不是因为在Timeleaf中没有使用Javascript?那么,是否不可能使用ckeditor?

根据,您需要一个
标记来加载库,并需要一点JavaScript来进行设置。所以你的例子应该是这样的:

<script src="https://cdn.ckeditor.com/ckeditor5/27.1.0/classic/ckeditor.js"></script>

翻页
书写页
作者:

标题:

内容:

分类编辑器 .create(document.querySelector(“#content”)) .catch(错误=>{ 控制台错误(error); } );
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="layout/default">
<head>
  <title>Make Page</title>
  <script src="https://cdn.ckeditor.com/ckeditor5/27.1.0/classic/ckeditor.js">
</script>
</head>

<body layout:fragment="content">
  <div style="text-align: center">
    <h1>write page</h1>
    <form  th:action="@{/createDiary}" th:object="${Diary}" method="post">
      <p>writer : <input type="text" th:field="*{writer}"/></p>
      <p>title : <input type="text" th:field="*{title}"/></p>
      <p>content : <input  style="width: 300px; height: 300px;" type="text" th:field="*{content}"/></p>
      <p><input type="submit" value="add"/> <input type="reset" value="reset"/></p>
    </form>
  </div>
  <script>
        ClassicEditor
            .create( document.querySelector( '#content' ) )
            .catch( error => {
                console.error( error );
            } );
  </script>
</body>
</html>