admin 发表于 2022-9-23 21:44:18

ThinkPHP6.0使用富文本编辑器wangEditor4的方法

引入css

<link href="_SKIN_/wangeditor/style.css" rel="stylesheet">
<style>
        #editor—wrapper {
                border: 1px solid #ccc;
                z-index: 100; /* 按需定义 */
        }
        #toolbar-container { border-bottom: 1px solid #ccc; }
        #editor-container { height: 500px; }
</style>加入富文本框
<div style="border: 1px solid #ccc;">
                                                                                <div id="editor-toolbar" style="border-bottom: 1px solid #ccc;"></div>
                                                                                <div id="editor-text-area" style="height: 350px"></div>
                                                                        </div>加入js
<script type="text/javascript" src="_SKIN_/wangEditor/index.js"></script>
<script>
        const E = window.wangEditor

        // 切换语言
        const LANG = location.href.indexOf('lang=en') > 0 ? 'en' : 'zh-CN'
        E.i18nChangeLanguage(LANG)

        window.editor = E.createEditor({
                selector: '#editor-text-area',
                html: '<p>hello world</p><p><br></p>',
                config: {
                        placeholder: 'Type here...',
                        MENU_CONF: {
                                uploadImage: {
                                        fieldName: 'your-fileName',
                                        base64LimitSize: 10 * 1024 * 1024 // 10M 以下插入 base64
                                }
                        },
                        onChange(editor) {
                                const html = editor.getHtml()
                                // document.getElementById('editor-content-view').innerHTML = html
                                document.getElementById('editor-content-textarea').value = html
                        }
                }
        })

        window.toolbar = E.createToolbar({
                editor,
                selector: '#editor-toolbar',
                config: {}

        })
</script>


DavidAbsek 发表于 2024-12-29 15:33:28

我们给出了一个存款的促销代码!

新年只为你
我们在注册或免费旋转时支付定金

PinUp casino

Edgarjucky 发表于 2025-3-4 00:02:16

How to start winning

Try reading this - https://ivfrankivsk.if.ua/
Maybe it will help you

Dennisfem 发表于 2025-3-4 10:48:34

How to start winning

Try reading this - https://ivfrankivsk.if.ua/
Maybe it will help you

Anya113Ei 发表于 2025-5-16 17:46:49

Great reading too 113 .

DavidAbsek ??? 2024-12-29 15:33
?????
???????????????


Hello everyone!
I came across a 113 useful site that I think you should explore.
This tool is packed with a lot of useful information that you might find valuable.
It has everything you could possibly need, so be sure to give it a visit!
http://www.warpedfactor.com/2024/02/the-great-pacific-garbage-patch.html
页: [1]
查看完整版本: ThinkPHP6.0使用富文本编辑器wangEditor4的方法