wangEditor/examples/index.html

54 lines
1.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>wangEditor example</title>
<style>
</style>
</head>
<body>
<p>
wangEditor demo
</p>
<div id="div1">
<p>欢迎使用 <b>wangEditor</b> 富文本编辑器</p>
<p>
<img src="http://www.wangeditor.com/imgs/logo.jpeg" />
</p>
</div>
<script src="../dist/wangEditor.js"></script>
<script>
// 改为使用var声明才能在window对象上获取到编辑器实例方便e2e测试
var E = window.wangEditor
var editor = new E('#div1')
editor.config.onchange = function (newHtml) {
console.log('onchange', newHtml)
}
editor.config.onblur = function (newHtml) {
console.log('onblur', newHtml)
}
editor.config.placeholder = '请输入...'
// editor.config.onfocus = function (newHtml) {
// console.log('onfocus', newHtml)
// }
// editor.config.fontNames = [
// '宋体',
// '微软雅黑',
// ]
// 这行代码用来测试不同屏幕宽度panel菜单的位置
// editor.config.menus = [
// 'image'
// ]
editor.config.showFullScreen = true
editor.create()
</script>
</body>
</html>