尊龙凯时人生就是博

ÔõÑùÔÚThinkPHP6ÖÐʹÓÃWangEditor¸»Îı¾±à¼­Æ÷£¿

Ëæ×Å»¥ÁªÍøµÄ¿ìËÙÉú³¤ £¬¸»Îı¾±à¼­Æ÷ÒѾ­³ÉΪÁËÍøÕ¾¿ª·¢Àú³ÌÖв»¿Éȱ°±ÉÄÒ»²¿·Ö¡£¶øwangeditor×÷Ϊº£ÄÚ¿ªÔ´µÄÒ»¿î¸»Îı¾±à¼­Æ÷ £¬Æä¾ß±¸Ò×Óá¢ÇáÁ¿¡¢¹¦Ð§¸»ºñµÈÓÅÒìÌصã £¬ÒѾ­Öð½¥³ÉΪÁËÐí¶à¿ª·¢ÕßµÄÊ×Ñ¡¡£

¶øThinkPHP6×÷ΪÏÖÔÚº£ÄÚ×îÖ÷Á÷µÄPHP¿ª·¢¿ò¼ÜÖ®Ò» £¬Ò²ÌṩÁ˸»ºñµÄÀ©Õ¹¹¦Ð§ £¬¿ÉÒÔ×ÊÖú¿ª·¢Õß¿ìËٵؼ¯³ÉWangEditor¸»Îı¾±à¼­Æ÷¡£±¾ÎĽ«ÏêϸÏÈÈÝÔõÑùÔÚThinkPHP6ÖÐʹÓÃWangEditor¸»Îı¾±à¼­Æ÷¡£

Ò»¡¢ÏÂÔØWangEditor

Ê×ÏÈ £¬ÎÒÃÇÐèÒªÏÂÔØWangEditor±à¼­Æ÷Ô´Âë¡£¿ÉÒÔÔÚWangEditorµÄ¹Ù·½ÍøÕ¾£¨https://www.wangeditor.com/£©ÉÏÏÂÔØ×îаæ¡£½âѹԴÂëºó £¬½«Ä¿Â¼¸´ÖƵ½ÎÒÃǵÄThinkPHP6ÏîÄ¿ÖеÄpublicĿ¼Ï¡£

¶þ¡¢ÒýÈëWangEditor×ÊÔ´Îļþ

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡± £»

ÔÚÎÒÃÇÐèҪʹÓÃWangEditorµÄÒ³ÃæÖÐ £¬ÎÒÃÇÐèÒªÒýÈëÒÔÏÂ×ÊÔ´Îļþ£º

<link rel="stylesheet" type="text/css" href="/public/wangEditor-3.1.1/release/wangEditor.min.css">
<script type="text/javascript" src="/public/wangEditor-3.1.1/release/wangEditor.min.js"></script>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬wangEditor.min.cssÊÇWangEditorµÄÑùʽÎļþ £¬wangEditor.min.jsÊÇWangEditorµÄÖ÷ÒªJavascriptÎļþ¡£

Èý¡¢½¨ÉèÒ³Ãæ

ÔÚÎÒÃÇÐèҪʹÓÃWangEditorµÄÒ³ÃæÖÐ £¬ÎÒÃÇÐèÒª½¨ÉèÒ»¸öÓÃÀ´ÏÔʾ±à¼­Æ÷µÄdivÈÝÆ÷ £¬²¢ÉèÖÃÒ»¸öID¡£ÀýÈ磺

<div id="editor"></div>

µÇ¼ºó¸´ÖÆ

ËÄ¡¢³õʼ»¯WangEditor

ÔÚÒ³Ãæ¼ÓÔØÍê³Éºó £¬ÎÒÃÇÐèÒª¶ÔWangEditor¾ÙÐгõʼ»¯ £¬ÎªÆäÉèÖÃÏà¹ØµÄ²ÎÊý¡£ÒÔÏÂÊÇÒ»¸ö¼òÆÓµÄʾÀý£º

<script type="text/javascript">
    var editor = new wangEditor('#editor');
    editor.create();
</script>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬#editorÊÇÎÒÃÇÉèÖõÄdivµÄID¡£Í¨¹ývar editor = new wangEditor(‘#editor’);¾ÙÐÐʵÀý»¯ £¬È»ºóͨ¹ýeditor.create()ÒªÁì³õʼ»¯±à¼­Æ÷¡£´Ëʱ £¬ÎÒÃǵÄÒ³Ãæ¾Í¿ÉÒÔʹÓÃWangEditor¸»Îı¾±à¼­Æ÷ÁË¡£

Îå¡¢ÉèÖñ༭Æ÷²ÎÊý

³ýÁ˳õʼ»¯±à¼­Æ÷Íâ £¬ÎÒÃÇ»¹¿ÉÒÔƾ֤ÐèÒªÉèÖñ༭Æ÷µÄ²ÎÊý¡£ÒÔÏÂÊÇһЩʾÀý £¬¸÷ÈË¿ÉÒÔƾ֤ÐèÇó×ÔÐÐÑ¡Ôñ£º

ÉèÖñ༭Æ÷µÄ¿í¶ÈºÍ¸ß¶È

var editor = new wangEditor('#editor');
editor.config.height = 500;    //ÉèÖñ༭Æ÷¸ß¶È
editor.config.width = '100%';  //ÉèÖñ༭Æ÷¿í¶È

µÇ¼ºó¸´ÖÆ

ÉèÖñ༭Æ÷µÄ×ÖÌåÑÕÉ«ºÍÅä¾°ÑÕÉ«

var editor = new wangEditor('#editor');
editor.config.colors = [    //ÉèÖÃÑÕÉ«Ñ¡Ïî
    '#000000', '#eeece0', '#1c487f', '#4d80bf', '#c9c9c9', 
    '#999999', '#005bac', '#ccb8b8', '#7f7f7f', '#f5f5f5', 
    '#c3d69b', '#acc8cc', '#d5e8d4', '#f6cfca', '#ff5555'
];
editor.config.menus = [
    'forecolor',  //×ÖÌåÑÕÉ«
    'bgcolor'     //Åä¾°ÑÕÉ«
];

µÇ¼ºó¸´ÖÆ

ÉèÖñ༭Æ÷µÄ×ÖÌå

var editor = new wangEditor('#editor');
editor.config.fontNames = [
    '΢ÈíÑźÚ', 'ËÎÌå', 'Arial', 'Tahoma', 'Verdana'
];

µÇ¼ºó¸´ÖÆ

ÉèÖÃÉÏ´«Í¼Æ¬µÄ½Ó¿Ú

var editor = new wangEditor('#editor');
editor.config.uploadImgUrl = '/upload'  //ÉÏ´«Í¼Æ¬½Ó¿ÚµÄURL

µÇ¼ºó¸´ÖÆ

Áù¡¢»ñÈ¡±à¼­Æ÷ÖеÄÄÚÈÝ

ÔÚÓû§Íê³É±à¼­ºó £¬ÎÒÃÇÐèÒª»ñÈ¡±à¼­Æ÷ÖеÄÄÚÈÝ¡£ÒÔÏÂÊÇÒ»¸ö¼òÆÓµÄʾÀý£º

<script type="text/javascript">
    var editor = new wangEditor('#editor');
    editor.create();

    //»ñÈ¡±à¼­Æ÷ÖеÄÄÚÈÝ
    var content = editor.txt.html();   
</script>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬editor.txt.html()ÒªÁì·µ»Ø±à¼­Æ÷ÖеÄHTML×Ö·û´®¡£

×ܽá

ÒÔÉϾÍÊÇÔÚThinkPHP6ÖÐʹÓÃWangEditor¸»Îı¾±à¼­Æ÷µÄÏêϸÏÈÈÝ¡£Í¨¹ý¼òÆÓµØÒýÈë×ÊÔ´Îļþ¡¢½¨ÉèÒ³Ãæ¡¢³õʼ»¯±à¼­Æ÷ÒÔ¼°ÉèÖòÎÊý £¬ÎÒÃÇ¿ÉÒÔ¿ìËٵؼ¯³ÉWangEditor¸»Îı¾±à¼­Æ÷ £¬ÇáËÉʵÏÖ¸»Îı¾±à¼­¹¦Ð§¡£

ÒÔÉϾÍÊÇÔõÑùÔÚThinkPHP6ÖÐʹÓÃWangEditor¸»Îı¾±à¼­Æ÷£¿µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ