ModuleBase.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <div class="module">
  3. <div class="module-top">
  4. <span class="title">{{ componentNameList[type] }}</span>
  5. <div class="module-icon">
  6. <span><SvgIcon icon-class="copy" size="10" /></span>
  7. <span class="active"><SvgIcon icon-class="setup" size="10" /></span>
  8. <span><SvgIcon icon-class="delete" size="10" /></span>
  9. </div>
  10. </div>
  11. <div class="module-content">
  12. <slot name="content"></slot>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import { componentNameList } from '@/views/book/courseware/data/bookType.js';
  18. export default {
  19. name: 'ModuleBase',
  20. props: {
  21. type: {
  22. type: String,
  23. default: 'text',
  24. },
  25. },
  26. data() {
  27. return {
  28. isShow: false,
  29. componentNameList,
  30. };
  31. },
  32. };
  33. </script>
  34. <style lang="scss" scoped>
  35. .module {
  36. padding: 8px;
  37. border: 1px solid #5a5a5a;
  38. &-top {
  39. display: flex;
  40. justify-content: space-between;
  41. margin-bottom: 3px;
  42. .title {
  43. font-size: 12px;
  44. color: $label-color;
  45. }
  46. }
  47. &-icon {
  48. display: flex;
  49. column-gap: 8px;
  50. span {
  51. display: flex;
  52. align-items: center;
  53. justify-content: center;
  54. width: 16px;
  55. height: 16px;
  56. cursor: pointer;
  57. background-color: #fff;
  58. border-radius: 20px;
  59. &.active {
  60. background-color: #c9c9c9;
  61. }
  62. }
  63. }
  64. &-content {
  65. padding: 8px;
  66. background-color: #fff;
  67. }
  68. }
  69. </style>