1、使用富文本quill-editor发送后台数据有标签问题<p>
<img src="https://img.niaorui.com/blogimg/20251116/b1b2b96bb17c43ab9c7bfe4bbb4f113f.jpg" alt="Vue使用富文本quill-editor发送后台数据有标签问题:
“>
<img src="https://img.niaorui.com/blogimg/20251116/b576d594ebd44941b6a866519c3255dd.jpg" alt="Vue使用富文本quill-editor发送后台数据有标签问题:
“>
在点击确认提交的时候将富文本数据双向绑定的时候,添加 .replace(/<[^>]+>/g,””)
我的v-mode是searchDataAdd.yj_desc,所以就在submit()事件提交的时候添加即可
this.searchDataAdd.yj_desc = this.searchDataAdd.yj_desc.replace(/<[^>]+>/g,””)
2、如果后台返回的数据,到页面上面有标签的话就转码
<img src="https://img.niaorui.com/blogimg/20251116/02627e17737c4deaa7272dcbbaf839da.jpg" alt="Vue使用富文本quill-editor发送后台数据有标签问题:
“>
<img src="https://img.niaorui.com/blogimg/20251116/9703bb3a8b064b44ba3f11aa74699009.jpg" alt="Vue使用富文本quill-editor发送后台数据有标签问题:
“>