ProjectCard.vue 778 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div class="project-card" @click="goToProject(id)">
  3. <div class="project-name">{{name}}</div>
  4. <div class="project-description">
  5. {{description}}
  6. </div>
  7. </div>
  8. </template>
  9. <script lang="ts">
  10. import { defineComponent } from 'vue';
  11. export default defineComponent({
  12. props: {
  13. id: Number,
  14. name: String,
  15. description: String,
  16. },
  17. methods: {
  18. goToProject(id: number) {
  19. this.$router.push(`/project/${id}/schedule`);
  20. },
  21. },
  22. });
  23. </script>
  24. <style lang="scss" scoped>
  25. .project-card {
  26. display: inline-block;
  27. box-shadow: 0 0 1px #BDC3C7;
  28. border-radius: 5px;
  29. padding: 10px;
  30. height: 150px;
  31. width: 320px;
  32. margin: 10px auto;
  33. transition: all .3s ease;
  34. }
  35. .project-card:hover {
  36. box-shadow: 0 0 5px #BDC3C7;
  37. }
  38. </style>