gui-modal.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <gui-popup ref="guipopupformodal"
  3. :width="width"
  4. :canCloseByShade="canCloseByShade"
  5. :zIndex="zIndex"
  6. @close="eClose">
  7. <view
  8. :style="bodyStyle"
  9. @tap.stop.prevent="stopfun"
  10. class="gui-relative">
  11. <view>
  12. <text class="gui-block-text gui-text-center" v-if="isTitle"
  13. :style="titleStyle">{{title}}</text>
  14. </view>
  15. <view><slot name="content"></slot></view>
  16. <view><slot name="btns"></slot></view>
  17. <text
  18. class="gui-popup-close gui-block-text gui-absolute-rt gui-icons"
  19. :style="closeBtnStyle"
  20. @tap.stop.prevent="close"
  21. v-if="isCloseBtn">&#xe7a5;</text>
  22. </view>
  23. </gui-popup>
  24. </template>
  25. <script>
  26. export default{
  27. name : "gui-modal",
  28. props : {
  29. width : { type : String, default : '580rpx'},
  30. bodyStyle : { type : String, default : 'background-color:#FFFFFF; border-radius:6rpx;' },
  31. isCloseBtn : { type : Boolean, default : true },
  32. closeBtnStyle : { type : String, default : 'color:#2B2E3D; font-size:28rpx;' },
  33. isTitle : { type : Boolean, default : true },
  34. title : { type : String, default : 'title' },
  35. titleStyle : { type : String, default : 'line-height:100rpx; font-size:28rpx; font-weight:700; color:#2B2E3D;' },
  36. canCloseByShade : { type : Boolean, default : true },
  37. zIndex : { type : Number, default : 99 }
  38. },
  39. methods:{
  40. open : function(){
  41. this.$refs.guipopupformodal.open();
  42. this.$emit('open');
  43. },
  44. close : function(){
  45. this.$refs.guipopupformodal.close();
  46. this.$emit('close');
  47. },
  48. stopfun : function(e){
  49. e.stopPropagation();
  50. return null;
  51. },
  52. eClose : function(){
  53. this.$emit('close');
  54. }
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. .gui-popup-close{width:80rpx; height:80rpx; line-height:80rpx; text-align:center;}
  60. </style>