ソースを参照

添加头部返回按钮逻辑

lm 2 週間 前
コミット
e4bd46e4a5
2 ファイル変更28 行追加2 行削除
  1. 15 1
      src/layout/components/AppHeader.vue
  2. 13 1
      src/layout/index.vue

+ 15 - 1
src/layout/components/AppHeader.vue

@@ -1,15 +1,25 @@
 <template>
 <template>
     <div class="app_header">
     <div class="app_header">
+        <el-icon v-if="showBack" class="left_back" @click="$router.go(-1)"><ArrowLeftBold /></el-icon>
         智能教学评价系统
         智能教学评价系统
     </div>
     </div>
 </template>
 </template>
 
 
+<script setup lang="ts">
 
 
-<script setup lang="ts"></script>
+const props = defineProps({
+    showBack:{
+        type:Boolean,
+        default:true
+    }
+})
+
+</script>
 
 
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .app_header{
 .app_header{
+    position: relative;
     flex-shrink: 0;
     flex-shrink: 0;
     display: flex;
     display: flex;
     justify-content: center;
     justify-content: center;
@@ -21,5 +31,9 @@
     font-weight: 600;
     font-weight: 600;
     font-size: calc(16 * var(--app-rpx));
     font-size: calc(16 * var(--app-rpx));
     color: #333;
     color: #333;
+    .left_back{
+        position: absolute;
+        left: calc(20 * var(--app-rpx));
+    }
 }
 }
 </style>
 </style>

+ 13 - 1
src/layout/index.vue

@@ -1,6 +1,9 @@
 <template>
 <template>
   <div class="layout">
   <div class="layout">
-    <component :is="finalHeader" :horizontalNavList="horizontalNavList" />
+    <component :is="finalHeader" 
+      :horizontalNavList="horizontalNavList" 
+      :showBack="showBack" 
+    />
     <AppMain :menuItems="menuList"/>
     <AppMain :menuItems="menuList"/>
   </div>
   </div>
 </template>
 </template>
@@ -26,6 +29,15 @@ const horizontalNavList = computed(()=>{
   return []
   return []
 })
 })
 
 
+const showBack = computed(()=>{
+  if(route.path.startsWith('/app') && route.path !== '/app' 
+      && route.path !== '/app/' && !route.path.startsWith('/app/questionnaireTaskListPage')){
+    return true
+  }else{
+    return false
+  }
+})
+
 const finalHeader = computed(()=>{
 const finalHeader = computed(()=>{
   if(route.path.startsWith('/main')){
   if(route.path.startsWith('/main')){
     return Header
     return Header