Window.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. margin: 10px;
  29. background-color: #ffffff;
  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. background-color: #e5e7ea;
  38. align-items: center;
  39. height: 40px;
  40. }
  41. .header-text {
  42. flex: 1;
  43. margin-left: 10px;
  44. margin-right: 10px;
  45. }
  46. .close-button {
  47. display: flex;
  48. justify-content: center;
  49. align-items: center;
  50. width: 40px;
  51. height: 40px;
  52. cursor: pointer;
  53. }
  54. </style>