当前位置:网站首页>. Use of net mvc5 rich text [wangeditor5]
. Use of net mvc5 rich text [wangeditor5]
2022-06-09 12:58:00 【Shunnet】
The previous version [wangEditor3] Single function , A little BUG, But it does not affect the use , I used it all the time , I wanted to change to the latest version not long ago [wangEditor5] But it has been echoing this implementation , Later I saw that they are more like dynamic assignment , The echo problem has been solved , Just use the latest version
Get to the point , Let's go straight to the latest edition [wangEditor5] stay MVC5 And MVC4 Basic usage in
【 Based on using 】
<!-- introduce css -->
<link href="https://unpkg.com/@wangeditor/[email protected]/dist/css/style.css" rel="stylesheet">
<!-- Rich text edit box -->
<div id="toolbar-container" style="border: 1px solid #E5E5E5; width:1100px; "></div>
<div id="editor-container" style="height: 700px; width: 1100px; border: 1px solid #E5E5E5;"></div>
<!-- introduce js -->
<script src="https://unpkg.com/@wangeditor/[email protected]/dist/index.js"></script>
<script>
const { createEditor, createToolbar } = window.wangEditor;
// Editor configuration
const editorConfig = {};
editorConfig.placeholder = ' Please enter the content ';
// Toolbar configuration
const toolbarConfig = {};
// Create editor
const editor = createEditor({
selector: '#editor-container',
config: editorConfig,
mode: 'simple' // default or 'simple' Refer to the below
});
// Create toolbars
const toolbar = createToolbar({
editor,
selector: '#toolbar-container',
config: toolbarConfig,
mode: 'simple' // default or 'simple' Refer to the below
});
</script>Copy
【 The echo data 】: When editing and modifying , How data is echoed from the background to rich text
<!-- introduce css -->
<link href="https://unpkg.com/@wangeditor/[email protected]/dist/css/style.css" rel="stylesheet">
<!-- Hide with a ID To save the data returned from the background html Information , This belongs to MVC How to use -->
@Html.Hidden("HtmlData", htmldata)
<!-- Rich text edit box -->
<div id="toolbar-container" style="border: 1px solid #E5E5E5; width:1100px; "></div>
<div id="editor-container" style="height: 700px; width: 1100px; border: 1px solid #E5E5E5;"></div>
<!-- introduce js -->
<script src="https://unpkg.com/@wangeditor/[email protected]/dist/index.js"></script>
<script>
const { createEditor, createToolbar } = window.wangEditor;
// Editor configuration
const editorConfig = {};
editorConfig.placeholder = ' Please enter the content ';
// Toolbar configuration
const toolbarConfig = {};
// Create editor
const editor = createEditor({
selector: '#editor-container',
config: editorConfig,
mode: 'simple' // default or 'simple' Refer to the below
});
// Create toolbars
const toolbar = createToolbar({
editor,
selector: '#toolbar-container',
config: toolbarConfig,
mode: 'simple' // default or 'simple' Refer to the below
});
</script>
<script>
var info = $("#HtmlData").val();
// Perform dynamic assignment
editor.setHtml(info);
</script>Copy
Get it done
“ Focus on [ Downstream network ] WeChat official account , Learn more and more interesting real-time information ”
The author of this article :[ Blogger ] dashun
Link to this article :https://shunnet.top/i2QRzy
Copyright notice : Reprint with reference to , thank you
边栏推荐
- 聊聊最近的一些情况
- 【 Redis底层机制解读:linux操作系统文件描述符FD 】
- .Net MVC5 富文本[wangEditor5] 的使用
- 使 QComboBox 下拉一个带复选框的树形列表
- kubernetes配置拉取私有镜像仓库
- 【STM32】HAL库-ADC
- Hype plagiarism, insider fraud common NFT scams and security suggestions on opensea
- Use of path gradient brush in gdi+
- Who says redis can't save big keys
- Make qcombobox drop down a tree structure list
猜你喜欢
随机推荐
GDI+ 中区域的使用
.Net MVC5 富文本[wangEditor5] 的使用
工程师应该了解的模态分析基础知识
WPF中控件单击双击冲突的解决方案
[STM32] Hal library DAC
用JS压缩上传的图片
Lombok - exception non static variable org cannot be referred from a static context
mdadm: cannot open /dev/sda1: Device or resource busy
勤于奋国外LEAD赚钱,谈任务的重要性
Warning: Accessing non-existent property ‘column‘ of module exports inside circular depen
Basic image transformation in gdi+
Loki: like Prometheus, but for logs
使 QComboBox 下拉一个树形结构列表
C#/VB.NET 在PDF表格中添加条形码
[简化] [排除]
. Net basic knowledge quick pass 11
LeetCode-732. My schedule III, differential array
Gaussdb (for redis) new feature release: prefix search thousand fold promotion and cluster multi tenancy isolation
微信小程序中实现吸顶效果(流畅、不卡顿)
[Loki introduction, deployment, use]







