feat:修改富文本图片宽度

This commit is contained in:
lixg
2023-03-07 21:45:55 +08:00
parent ad63266ef4
commit 14c787445a
5 changed files with 16 additions and 17 deletions

View File

@@ -653,7 +653,7 @@ function send() {
.discussdetail {
width: 100%;
.discussdetail_img_class img {
max-width: 100%;
max-width: 100% !important;
}
.tithead {
margin-top: 10px;

View File

@@ -194,17 +194,17 @@ function getPostList(discussId) {
})
.then((e) => {
console.log("我是当前讨论下的帖子", e);
if (e.data.records) {
let arr = e.data.records;
for (let i = 0; i < arr.length; i++) {
let obj = arr[i].content;
let regex = new RegExp("<img", "gi");
let deleteStyle = /(?<=\" )style=\".*?\"/gi;
obj = obj.replace(deleteStyle, "");
obj = obj.replace(regex, '<img style="max-width: 100%;height:auto"');
arr[i].content = obj;
}
}
// if (e.data.records) {
// let arr = e.data.records;
// for (let i = 0; i < arr.length; i++) {
// let obj = arr[i].content;
// let regex = new RegExp("<img", "gi");
// let deleteStyle = /(?<=\" )style=\".*?\"/gi;
// obj = obj.replace(deleteStyle, "");
// obj = obj.replace(regex, '<img style="max-width: 100%;height:auto"');
// arr[i].content = obj;
// }
// }
state.postList = state.postList.concat(e.data.records);
state.total = Number(e.data.total);
if (e.data.records.length === 0 || e.data.records.length < 10) {
@@ -302,7 +302,7 @@ function handleCurrentChange(e, k) {
.discusspage {
width: 100%;
.discusspage_img_class img {
max-width: 100%;
max-width: 100% !important;
}
.head {
margin-top: 10px;

View File

@@ -251,7 +251,7 @@ function formateArr(strs) {
width: 100%;
padding-bottom: 20px;
.faceteachnocommon_img_class img {
max-width: 100%;
max-width: 100% !important;
}
.main {
width: 100%;

View File

@@ -246,7 +246,7 @@ function formateArr(strs) {
width: 100%;
padding-bottom: 20px;
.faceteachnocourse_img_class img {
max-width: 100%;
max-width: 100% !important;
}
.main {
width: 100%;

View File

@@ -1,7 +1,6 @@
<template>
<div class="faceteachsignup">
<ReturnHead text="课程详情"></ReturnHead>
<div class="main">
<div class="title">
<div class="faceteachimgname">
@@ -341,7 +340,7 @@ function getImgInfo(url, i, imgs) {
width: 100%;
padding-bottom: 20px;
.faceteachsignup_img_class img {
max-width: 100%;
max-width: 100% !important;
}
.main {
width: 100%;