BottomModalWrapper.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <div class="mobile-modal" v-if="showModal" @click="$emit('closeAction', false)">
  3. <div class="mobile-modal-box bottom-modal-wrapper" @click="stopPropagation($event)">
  4. <div class="bottom-modal-header">{{title}}<i @click="$emit('closeAction', false)" class="icon-guanbi1 iconfont"></i></div>
  5. <slot></slot>
  6. <div class="bottom-modal-footer" @click="$emit('closeAction', true)">{{submitText}}</div>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. props: {
  13. showModal: {
  14. type: Boolean,
  15. default: false
  16. },
  17. title: {
  18. type: String,
  19. default: ''
  20. },
  21. submitText: {
  22. type: String,
  23. default: '确定'
  24. }
  25. }
  26. // watch: {
  27. // showModal: {
  28. // handler: function (val) {
  29. // if (val) {
  30. // this.init()
  31. // }
  32. // }
  33. // }
  34. // },
  35. // methods: {
  36. // init () {
  37. // this.$nextTick(() => {
  38. // this._initscroll()
  39. // })
  40. // }
  41. // },
  42. // mounted() {
  43. // this.init()
  44. // }
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .mobile-modal {
  49. .bottom-modal-wrapper {
  50. bottom: 0;
  51. top: initial;
  52. left: 0;
  53. right: 0;
  54. text-align: center;
  55. .bottom-modal-header {
  56. height: 1rem;
  57. line-height: 1rem;
  58. font-weight: bold;
  59. font-size: .42rem;
  60. background: #fff;
  61. position: relative;
  62. border-top-left-radius: .2rem;
  63. border-top-right-radius: .2rem;
  64. i {
  65. font-size: .32rem;
  66. position: absolute;
  67. right: .2rem;
  68. top: 0;
  69. color: #bfbfbf;
  70. }
  71. }
  72. .bottom-modal-footer {
  73. height: 1rem;
  74. line-height: 1rem;
  75. background: #3f84f6;
  76. font-size: .36rem;
  77. color: #fff;
  78. }
  79. }
  80. }
  81. </style>