一个页面多个编辑器

wangEditor 支持一个页面创建多个编辑器。

<head>
    <style type="text/css">
        .toolbar {
            background-color: #f1f1f1;
            border: 1px solid #ccc;
        }
        .text {
            border: 1px solid #ccc;
            height: 200px;
        }
    </style>
</head>
<body>
    <div id="div1" class="toolbar">
    </div>
    <div style="padding: 5px 0; color: #ccc">中间隔离带</div>
    <div id="div2" class="text">
        <p>第一个 demo(菜单和编辑器区域分开)</p>
    </div>

    <div id="div3">
        <p>第二个 demo(常规)</p>
    </div>

    <!-- 引入 wangEditor.min.js -->
    <script type="text/javascript">
        const E = window.wangEditor

        const editor1 = new E('#div1', '#div2')
        editor1.create()

        const editor2 = new E('#div3')
        editor2.create()
    </script>
</body>
Copyright © wangEditor (2020 - present) all right reserved,powered by GitbookFile Modify: 2022-04-11 07:03:47

results matching ""

    No results matching ""