Przeglądaj źródła

论坛按钮配置

canghailong 6 miesięcy temu
rodzic
commit
cceb9bc2ba
1 zmienionych plików z 8 dodań i 4 usunięć
  1. 8 4
      src/views/student/forumBtn/index.vue

+ 8 - 4
src/views/student/forumBtn/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="redressBox">
-		<div class="addBox joinBox">
+		<div class="addBox joinBox" v-if="intersect">
 			<div v-if="props.isShow.includes(2)" class="btnBox">
 				<router-link
 					:to="{
@@ -38,8 +38,8 @@
 				</router-link>
 			</div>
 		</div>
-		<div class="mt-3 joinBox">
-			<div v-if="props.isShow.includes(3)" class="btnBox mt-2">
+		<div class="mt-3 joinBox" v-if="props.isShow.includes(3)">
+			<div class="btnBox mt-2">
 				<router-link :to="{ path: '/forum' }" target="_blank">
 					<CommentOutlined class="textColor" style="font-size: 30px" />
 					<div class="textColor">讨论</div>
@@ -54,18 +54,22 @@
 	const router = useRouter()
 	const props = defineProps({
 		isShow: {
-			type: Array,
+			type: [Array,String,Number],
 			default: [0, 1, 2, 3]
 		},
 		forumData: {
 			type: Object,
 			default: () => {}
 		},
+		//纠错类型 0课程章节 1作业 2考试
 		resourceType: {
 			type: [String, Number],
 			default: ''
 		}
 	})
+	const intersect = computed(()=>{
+		return [0, 1, 2].filter(e=>props.isShow.includes(e)).length
+	})
 	const jumpRedressUrl = (t) => {
 		router.push({
 			path: '/forum/addForum',