知识学习

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 5618|回复: 4

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

[复制链接]

升级   100%

152

主题

0

回帖

752

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
752
发表于 2022-9-23 21:44:18 | 显示全部楼层 |阅读模式
引入css

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

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

  7.         window.editor = E.createEditor({
  8.                 selector: '#editor-text-area',
  9.                 html: '<p>hello world</p><p><br></p>',
  10.                 config: {
  11.                         placeholder: 'Type here...',
  12.                         MENU_CONF: {
  13.                                 uploadImage: {
  14.                                         fieldName: 'your-fileName',
  15.                                         base64LimitSize: 10 * 1024 * 1024 // 10M 以下插入 base64
  16.                                 }
  17.                         },
  18.                         onChange(editor) {
  19.                                 const html = editor.getHtml()
  20.                                 // document.getElementById('editor-content-view').innerHTML = html
  21.                                 document.getElementById('editor-content-textarea').value = html
  22.                         }
  23.                 }
  24.         })

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

  29.         })
  30. </script>
复制代码



回复

使用道具 举报

升级   24%

0

主题

4

回帖

12

积分

新手上路

Rank: 1

积分
12
发表于 2024-12-29 15:33:28 | 显示全部楼层

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

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

PinUp casino
回复

使用道具 举报

升级   68%

0

主题

2

回帖

34

积分

新手上路

Rank: 1

积分
34
发表于 2025-3-4 00:02:16 | 显示全部楼层

How to start winning

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

使用道具 举报

升级   76%

0

主题

2

回帖

38

积分

新手上路

Rank: 1

积分
38
发表于 2025-3-4 10:48:34 | 显示全部楼层

How to start winning

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

使用道具 举报

升级   28%

0

主题

3

回帖

14

积分

新手上路

Rank: 1

积分
14
发表于 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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|知识学习 ( 鲁ICP备20015483号 )

GMT+8, 2026-5-13 21:56 , Processed in 0.073338 second(s), 27 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表