| | |
| | | <i class="myiconfont icon-shuaxin"></i> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="main"> |
| | | <div |
| | | class="main_item flex items-center cursor-pointer" |
| | | v-for="(item, index) in state.exampleContent" |
| | | :key="index" |
| | | :class="{ main_item_active: item.sample_id === activeSampleId }" |
| | | @click="changeExample(item)" |
| | | > |
| | | <div class="left flex items-center justify-center" :class="['color' + index]"> |
| | | <img :src="item.Icon" alt="" /> |
| | | </div> |
| | | <div class="right"> |
| | | <h4>{{ item.sample_title }}</h4> |
| | | <p>{{ item.sample_question }}</p> |
| | | </div> |
| | | </div> |
| | | <el-carousel height="80" :interval="5000" indicator-position="none"> |
| | | <el-carousel-item v-for="group in batchSourceData" :key="group" class="set-carousel-item"> |
| | | <div |
| | | class="main_item flex items-center cursor-pointer" |
| | | v-for="(item, index) in state.exampleContent" |
| | | :key="index" |
| | | :class="{ main_item_active: item.sample_id === activeSampleId }" |
| | | @click="changeExample(item)" |
| | | > |
| | | <div class="left flex items-center justify-center" :class="['color' + index]"> |
| | | <img :src="item.Icon" alt="" /> |
| | | </div> |
| | | <div class="right"> |
| | | <h4>{{ item.sample_title }}</h4> |
| | | <p>{{ item.sample_question }}</p> |
| | | </div> |
| | | </div> |
| | | </el-carousel-item> |
| | | </el-carousel> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | onMounted(() => { |
| | | getSelectListSample(); |
| | | }); |
| | | //换一批数据源 |
| | | const groupedArray = computed(() => { |
| | | const groups = []; |
| | | let i = 0; |
| | |
| | | groups.push(state.exampleRandomContent.slice(i, (i += 4))); |
| | | } |
| | | return groups; |
| | | }); |
| | | //自动播放 |
| | | const batchSourceData = computed(() => { |
| | | const batch = []; |
| | | let i = 0; |
| | | while (exampleList.value.length > i) { |
| | | batch.push(exampleList.value.slice(i, (i += 4))); |
| | | } |
| | | return batch; |
| | | }); |
| | | //获取模版列表 |
| | | const getSelectListSample = async () => { |
| | |
| | | } |
| | | } |
| | | } |
| | | .set-carousel-item { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | :deep(.el-drawer__body) { |
| | | overflow-x: hidden; |
| | | } |
| | | :deep(.el-carousel--horizontal) { |
| | | width: 100%; |
| | | } |
| | | :deep(.el-carousel__container) { |
| | | width: 100%; |
| | | height: 200px !important; |
| | | } |
| | | </style> |