【毕设Day12】

前言

第六天啦!!!加油加油加油!!!


一、使用Swiper轮播图

1.安装低版本的Swiper

网址:https://github.com/surmon-china/vue-awesome-swiper
安装命令:
npm install swiper@5.x vue-awesome-swiper --save

全局引入

import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper'

//import style (<= Swiper 5.x)
import 'swiper/css/swiper.css'

Vue.use(VueAwesomeSwiper, /* { default options with global component } */)

2.使用模板

<template>
  <div class="mySwiper">
    <!-- options配置项 -->
    <swiper ref="mySwiper" :options="swiperOptions">
      <swiper-slide>Slide 1</swiper-slide>
      <swiper-slide>Slide 2</swiper-slide>
      <swiper-slide>Slide 3</swiper-slide>
      <swiper-slide>Slide 4</swiper-slide>
      <swiper-slide>Slide 5</swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)

export default {
  name: "CovidSwiper",
  data() {
    return {
      arr: ["111", "222", "333"],
      swiperOptions: {
        //配置swiper设置,比如自动轮播等
        pagination: {
          el: ".swiper-pagination",
        },
        autoplay: true,
        speed: 600,
        // Some Swiper option/callback...
      },
    };
  },
  computed: {
    swiper() {
      return this.$refs.mySwiper.$swiper;
    },
  },
  mounted() {
    console.log("Current Swiper instance object", this.swiper);
    this.swiper.slideTo(3, 1000, false);
  },
};
</script>

二、增加轮播图标识

1.增加标识卡

在这里插入图片描述

    <!-- 轮播图标识 -->
    <div class="wrapper">
      <div
        class="item"
        :class="{ active: index == 0 }"
        v-for="(item, index) in arr"
        :key="index"
        @click="changeSwiper(index)"
      >
        {{ item }}
      </div>
    </div>

2.轮播图绑定标识卡,实现点击标识卡,切换对应轮播图

绑定点击事件@click="changeSwiper(index)"
将下标传给轮播图的slideTo函数

  methods: {
    changeSwiper(index) {
      //   console.log("-----index", index);
      //   切换swiper显示---去哪里
      this.swiper.slideTo(index, 1000, false);
      // 点击高亮
      this.activeIndex = index;
    },
  },

3.实现点击轮播图,切换对应标识卡

使用swiper的事件,this.activeIndex为swiper自带的activeIndex,
所以我们这里保存的activeIndex使用的是that

// Some Swiper option/callback...
        on: {
          slideChangeTransitionStart: function () {
            console.log(this.activeIndex);
            that.activeIndex = this.activeIndex;
          },
        },

三、疫情曲线图

1.在base.js中添加疫情曲线图api

//疫情曲线图
covidImage: 'http://iwenwiki.com/wapicovid19/ncovimg.php'

2.在index.js中封装请求折线图函数covidImage()

//疫情折线图
covidImage() {
    return axios.get(base.covidImage)
}

3.在CovidSwiper中请求数据

在这里插入图片描述

  mounted() {
    //请求折线图数据
    this.$api.covidImage().then((res) => {
      console.log("=======", res.data);
      if (res.data.status === 200) {
        this.covidArr = res.data.result;
      }
    });
  },

使用图片数据(item.image、item.title)进行轮播

  <div class="mySwiper">
    <!-- options配置项 -->
    <swiper ref="mySwiper" :options="swiperOptions">
      <swiper-slide v-for="(item, index) in covidArr" :key="index">
        <img :src="item.image" alt="" />
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
    <!-- 轮播图标识 -->
    <div class="wrapper">
      <div
        class="item"
        :class="{ active: index == activeIndex }"
        v-for="(item, index) in covidArr"
        :key="index"
        @click="changeSwiper(index)"
      >
        {{ item.title }}
      </div>
    </div>
  </div>

最终效果:轮播图和标识卡实现点击切换交互。
在这里插入图片描述

### 如何在一周内高效完成毕业设计论文 要在短时间内高质量地完成毕业设计论文,需要合理规划时间并充分利用现有资源和技术工具。以下是具体方法: #### 时间分配与任务分解 为了有效利用有限的时间,在一周内完成毕业设计论文的关键在于清晰的任务划分和严格的时间管理。可以按照以下结构安排每日的工作重点[^1]。 - **第1天至第2天**:集中整理已有的研究资料、实验数据以及初步结论。重新审视题目要求,明确论文的核心目标。 - **第3天**:撰写论文的主要章节内容(如背景分析、理论基础、设计方案)。这部分应占全文较大篇幅,需确保逻辑严谨且条理清晰。 - **第4天**:补充完善次要部分的内容,比如前言、总结展望等辅助性段落;同时调整图表样式使其更加美观易读。 - **第5天**:进行整体润色修改,修正语法错误,优化表达方式,并确认所有引用格式正确无误。 - **第6天**:准备答辩材料,制作PPT演示文档,练习口头陈述流程。 - **第7天**:最终校对全文细节,打印装订成册,上传电子版本文件给导师审核反馈意见后再做最后修订提交。 #### 技术支持与协作平台的选择 考虑到传统模式下的信息传递效率低下问题,推荐采用现代化信息技术手段来提升工作效率。例如建立专门用于讨论交流的在线论坛或者即时通讯群组以便于师生之间快速交换想法观点;借助云计算存储服务共享大容量多媒体素材减少本地传输耗时等问题发生几率等等。 另外还可以考虑引入一些自动化处理软件帮助简化重复劳动强度较高的子任务执行过程,像LaTeX排版引擎能够自动生成目录索引页码编号等功能极大地方便了学术型文档编辑工作;EndNote/Zotero类参考文献管理插件则可轻松实现跨平台同步收藏管理海量期刊书籍链接地址摘要记录等内容从而节省查找核实出处所花费的时间成本。 #### 注意事项 尽管存在上述多种便利措施可供采纳实施但仍需注意保持良好心态面对可能出现的各种突发状况灵活应对调整策略直至顺利完成全部预定计划为止。 ```python def weekly_plan(): days = ["Day 1", "Day 2", "Day 3", "Day 4", "Day 5", "Day 6", "Day 7"] tasks = [ "Organize existing research materials and data.", "Clarify the core objectives of the thesis topic.", "Write main sections including background analysis, theoretical basis, design scheme etc.", "Supplement secondary parts such as introduction, conclusion outlook auxiliary paragraphs; adjust chart styles to make them more aesthetically pleasing and readable", "Polish up entire text details, correct grammar mistakes, optimize expressions while ensuring all citation formats are accurate without errors", "Prepare presentation materials, create PPT slideshows practice oral statement procedures ", "Final proofreading full document minor points print bind into booklets upload electronic version files for teacher review feedback then do last revision submission" ] plan = {day: task for day,task in zip(days,tasks)} return plan weekly_schedule = weekly_plan() for k,v in weekly_schedule.items(): print(f"{k}: {v}") ```
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值