2021年9月1日

vue中(input组件)textarea文本提交到后端数据库,前端输出保存换行回车及修改显示

摘要: 提交前先正则过滤: (此处content为textarea输入值) var content = this.content.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, '&nbsp;'); 展示的时候用 v-html 阅读全文

posted @ 2021-09-01 09:27 一名小学生呀 阅读(2175) 评论(0) 推荐(0)

导航