Ver código fonte

轮播图跳转

lrf 8 meses atrás
pai
commit
462c60a3fb
1 arquivos alterados com 15 adições e 2 exclusões
  1. 15 2
      src/components/custom/custom-layout.vue

+ 15 - 2
src/components/custom/custom-layout.vue

@@ -42,14 +42,23 @@
       <div class="header_3" v-if="is_carousel">
         <el-carousel height="300px">
           <el-carousel-item v-for="(item, index) in carouselList" :key="index">
-            <el-image class="image" :src="getUrlFile(item)" fit="fill" />
+            <el-image class="image" :src="getUrlFile(item)" fit="fill" @click="toRedirect(item)" />
           </el-carousel-item>
         </el-carousel>
       </div>
       <el-col :span="24" class="header_2">
         <div class="list_1300">
           <el-col :span="24" class="list">
-            <div class="text" v-for="(item, index) in data" @click="selectMenu(item.route)" :class="[item.hover == '1' ? 'menuTrue' : '']" :style="{ padding: isIncubator ? '0 37px' : hasbrain ? '0 37px' : '0 52px' }" :key="index" @mouseover="handleMouseOver(index)" @mouseout="handleMousOut(index)">
+            <div
+              class="text"
+              v-for="(item, index) in data"
+              @click="selectMenu(item.route)"
+              :class="[item.hover == '1' ? 'menuTrue' : '']"
+              :style="{ padding: isIncubator ? '0 37px' : hasbrain ? '0 37px' : '0 52px' }"
+              :key="index"
+              @mouseover="handleMouseOver(index)"
+              @mouseout="handleMousOut(index)"
+            >
               {{ item.title }}
             </div>
           </el-col>
@@ -220,6 +229,10 @@ const toOut = () => {
   userStore.logOut()
   router.push({ path: '/login', query: { status: '1' } })
 }
+const toRedirect = (data) => {
+  const to = get(data, 'to')
+  if (to) window.open(to)
+}
 </script>
 
 <style lang="scss" scoped>