快速上手
安装
html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Example</title>
</head>
<body>
<textarea id='editor'></textarea>
<script src='/dist/tinymce.min.js'></script>
<script>
tinymce.init({
selector: '#editor',
language: 'zh-Hans',
promotion: false,
branding: false,
menubar: false,
min_height: 640,
// 图片上传
images_upload_handler: (blobInfo, progress) => {
return new Promise((resolve, reject) => {
const url = URL.createObjectURL(blobInfo.blob())
resolve(url)
})
},
plugins: 'core question answer analysis answerfield option code autoresize table image divider pinyin wavyunderline doubleunderline formula valigntop valignmiddle valignbottom shadowquestionnumber',
toolbar: 'code undo redo table image underline divider pinyin underwavy doubleunderline formula valigntop valignmiddle valignbottom',
contextmenu: 'question shadowquestionnumber option divider answer analysis answerfield image table',
text_patterns: false,
})
</script>
</body>
</html>