Window.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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: 1px solid black;
  31. box-shadow: 3px 3px 5px black;
  32. }
  33. .header {
  34. display: flex;
  35. justify-content: flex-end;
  36. align-items: center;
  37. height: 40px;
  38. }
  39. .header-text {
  40. flex: 1;
  41. margin-left: 10px;
  42. margin-right: 10px;
  43. }
  44. .close-button {
  45. display: flex;
  46. justify-content: center;
  47. align-items: center;
  48. width: 40px;
  49. height: 40px;
  50. cursor: pointer;
  51. }
  52. </style>