Window.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="window">
  3. <div class="header">
  4. <span class="header-text"><slot name="header"></slot></span>
  5. <span class="close-button" @click="close"><i class="el-icon-close"></i></span>
  6. </div>
  7. <slot></slot>
  8. </div>
  9. </template>
  10. <script>
  11. //-----------------------------------------------------------------------------
  12. import Vue from 'vue';
  13. import Component from 'vue-class-component';
  14. export default @Component({
  15. })
  16. class Window extends Vue {
  17. close() {
  18. this.$emit('close');
  19. }
  20. }
  21. //-----------------------------------------------------------------------------
  22. </script>
  23. <style scoped>
  24. .window {
  25. flex: 1;
  26. display: flex;
  27. flex-direction: column;
  28. background-color: #e5e7ea;
  29. margin: 10px;
  30. border: 3px double black;
  31. border-radius: 4px;
  32. box-shadow: 3px 3px 5px black;
  33. }
  34. .header {
  35. display: flex;
  36. justify-content: flex-end;
  37. align-items: center;
  38. height: 40px;
  39. }
  40. .header-text {
  41. flex: 1;
  42. margin-left: 10px;
  43. margin-right: 10px;
  44. }
  45. .close-button {
  46. display: flex;
  47. justify-content: center;
  48. align-items: center;
  49. width: 40px;
  50. height: 40px;
  51. cursor: pointer;
  52. }
  53. </style>