应用背景色处理函数

This commit is contained in:
WindowBird 2025-09-19 11:51:46 +08:00
parent 307e2ee29b
commit 55883c67b9
3 changed files with 8 additions and 14 deletions

View File

@ -60,7 +60,7 @@
</view>
<view class="description-content">
<rich-text
:nodes="activityData.content"
:nodes="removeBackgroundStyle(activityData.content)"
class="content-html"
></rich-text>
</view>
@ -100,6 +100,7 @@ import StatusDisplay from "../../components/status-display/status-display.vue";
import ActivityCard from "../../components/activity-card/activity-card.vue";
import activityApi from "../../api/activity/activity.js";
import activityFormatter from "../../utils/activity-data-formatter.js";
import { removeBackgroundStyle } from "../../composables/clearnBackgroundColor";
export default {
components: {
@ -133,6 +134,7 @@ export default {
}
},
methods: {
removeBackgroundStyle,
//
async loadPageData() {
if (!this.actId) return;

View File

@ -28,6 +28,8 @@
</template>
<script>
import { removeBackgroundStyle } from "../../composables/clearnBackgroundColor";
export default {
name: "projectDetail",
data() {
@ -49,6 +51,7 @@ export default {
};
},
methods: {
removeBackgroundStyle,
//
formatDate(timestamp) {
//return this.$u.date(timestamp, "yyyy-mm-dd");
@ -62,13 +65,6 @@ export default {
// }
return timestamp;
},
removeBackgroundStyle(html) {
if (!html) return [];
// 1.
return html.replace(/background-color:[^;"]*;?/g, "");
},
},
};
</script>

View File

@ -60,6 +60,7 @@
import CommonEnum from "../../enum/common";
import { createPagination } from "../../composables/winB_Pagination";
import { getProjectSchedule } from "../../api/institutionalStructure/institutionalStructureDetail";
import { removeBackgroundStyle } from "../../composables/clearnBackgroundColor";
export default {
components: {},
@ -115,12 +116,7 @@ export default {
},
methods: {
removeBackgroundStyle(html) {
if (!html) return [];
// 1.
return html.replace(/background-color:[^;"]*;?/g, "");
},
removeBackgroundStyle,
goProjectDetail(item) {
uni.navigateTo({