gui-modal.vue 1.7 KB

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