graceNvueBottomDialog.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view class="grace-btdialog-shade" v-if="show" @tap.stop="closeDialog" @touchmove.stop.prevent="stopFun" :style="{backgroundColor:background}">
  3. <view class="grace-btdialog-shade-dialog" @tap.stop="stopFun"
  4. :style="{borderTopLeftRadius:borderRadius,borderTopRightRadius:borderRadius,width:width,left:left}">
  5. <view class="title"><slot name="btns"></slot></view>
  6. <view class="content" @tap.stop="stopFun"><slot name="content"></slot></view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. props: {
  13. width:{type:String,default:'750rpx'},
  14. left:{type:String,default:'0rpx'},
  15. show : {
  16. type : Boolean,
  17. default : false
  18. },
  19. background:{
  20. type : String,
  21. default : 'rgba(0, 0, 0, 0.5)'
  22. },
  23. borderRadius : {
  24. type : String,
  25. default : '0rpx'
  26. }
  27. },
  28. data() {
  29. return {}
  30. },
  31. methods:{
  32. closeDialog : function(){
  33. this.$emit('closeDialog');
  34. },
  35. stopFun : function(){}
  36. }
  37. }
  38. </script>
  39. <style scoped>
  40. .grace-btdialog-shade{position:fixed; width:750rpx; left:0; top:0; bottom:0; background-color:rgba(0, 0, 0, 0.5);}
  41. .grace-btdialog-shade-dialog{width:750rpx; background-color:#FFFFFF; position:absolute; bottom:0; left:0;}
  42. .grace-btdialog-shade-title{flex-direction:row; flex-wrap:nowrap; justify-content:space-between;}
  43. .grace-btdialog-shade-content{}
  44. </style>