mainCard.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view>
  3. <swiper class="swiper" :indicator-dots="false" :autoplay="false" :circular="false">
  4. <swiper-item>
  5. <view class="swiper-item uni-bg-red">
  6. <hr />{{data.wordInfo}}
  7. </view>
  8. </swiper-item>
  9. <swiper-item>
  10. <view class="swiper-item uni-bg-red">
  11. 拼<hr />{{data.wordInfo}}
  12. </view>
  13. </swiper-item>
  14. <swiper-item>
  15. <view class="swiper-item uni-bg-blue">
  16. 读<hr />{{data.wordInfo}}
  17. </view>
  18. </swiper-item>
  19. <swiper-item>
  20. <view class="swiper-item uni-bg-blue">
  21. 选<hr />{{data.wordInfo}}
  22. </view>
  23. </swiper-item>
  24. <swiper-item>
  25. <view class="swiper-item uni-bg-blue">
  26. 背<hr />{{data.wordInfo}}
  27. </view>
  28. </swiper-item>
  29. </swiper>
  30. </view>
  31. </template>
  32. <script setup>
  33. import {
  34. reactive
  35. } from "vue";
  36. import * as httpApi from "@/api/word.js"
  37. import {
  38. onMounted
  39. } from 'vue';
  40. const props = defineProps({
  41. activeWord: {
  42. type: Object,
  43. },
  44. activeWords: {
  45. type: Array
  46. }
  47. })
  48. const data = reactive({
  49. wordInfo: null
  50. })
  51. function updateWordInfo() {
  52. httpApi.getWordInfo({
  53. wordId: props.activeWord.id
  54. }).then(res => {
  55. data.wordInfo = res.data;
  56. })
  57. }
  58. onMounted(() => {
  59. updateWordInfo();
  60. })
  61. </script>
  62. <style>
  63. </style>