PopupLayout.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="popup-layout j-container">
  3. <div class="j-header">
  4. <slot name="header">
  5. <div class="header-nav">
  6. <div class="header-nav-title">
  7. <slot name="title">
  8. {{ title }}
  9. </slot>
  10. </div>
  11. <div
  12. class="header-nav-close"
  13. name="clear"
  14. @click="closeIconClick"
  15. />
  16. </div>
  17. </slot>
  18. </div>
  19. <div class="j-main">
  20. <slot name="default" />
  21. </div>
  22. <div class="j-footer">
  23. <slot name="footer" />
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. export default {
  29. name: 'PopupLayout',
  30. props: {
  31. title: {
  32. type: String,
  33. default: '选择'
  34. }
  35. },
  36. methods: {
  37. closeIconClick() {
  38. this.$emit('closeIconClick')
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .header-nav {
  45. display: flex;
  46. align-items: center;
  47. justify-content: space-between;
  48. height: 64px;
  49. padding: 0 16px;
  50. .header-nav-title {
  51. font-size: 20px;
  52. color: #171826;
  53. }
  54. .header-nav-close {
  55. font-size: 22px;
  56. color: #c8c9cc;
  57. }
  58. }
  59. .popup-layout {
  60. .j-main > * {
  61. max-height: 60vh;
  62. }
  63. }
  64. </style>