mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-09 19:06:47 +08:00
feat:修改富文本图片宽度
This commit is contained in:
@@ -653,7 +653,7 @@ function send() {
|
||||
.discussdetail {
|
||||
width: 100%;
|
||||
.discussdetail_img_class img {
|
||||
max-width: 100%;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
.tithead {
|
||||
margin-top: 10px;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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%;
|
||||
|
||||
@@ -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%;
|
||||
|
||||
@@ -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%;
|
||||
|
||||
Reference in New Issue
Block a user