selectWords.vue 431 B

1234567891011121314151617181920212223242526
  1. <template>
  2. <view class="select-words">
  3. <span v-for="item in activeWords" :class="{active: activeWord.id == item.id}">{{item.name}}</span>
  4. </view>
  5. </template>
  6. <script setup>
  7. const props = defineProps({
  8. activeWord: {
  9. type: Object,
  10. },
  11. activeWords: {
  12. type: Array
  13. },
  14. })
  15. </script>
  16. <style lang="scss" scoped>
  17. .select-words {
  18. display: flex;
  19. justify-content: space-between;
  20. }
  21. .active {
  22. color: red;
  23. }
  24. </style>