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 { .discussdetail {
width: 100%; width: 100%;
.discussdetail_img_class img { .discussdetail_img_class img {
max-width: 100%; max-width: 100% !important;
} }
.tithead { .tithead {
margin-top: 10px; margin-top: 10px;

View File

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

View File

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

View File

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

View File

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