popup.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="modalhtml" v-if="isshow">
  3. <view class="modal">
  4. <view class="title">
  5. {{title}}
  6. </view>
  7. <view class="content">
  8. {{content}}
  9. </view>
  10. <view class="btns">
  11. <view class="cancel">关闭</view>
  12. <view class="ok" @tap="ok">确认</view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. props: {
  20. },
  21. data() {
  22. return {
  23. isshow:false,
  24. title:'提示',
  25. content:'',
  26. data:[],
  27. }
  28. },
  29. methods: {
  30. open(data){
  31. this.data=data;
  32. this.isshow=true;
  33. },
  34. ok(){
  35. this.$emit('ok',this.data.ok)
  36. this.isshow=false;
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. .modalhtml{
  43. position: fixed;
  44. z-index: 999999;
  45. top:0px;
  46. width: 100%;
  47. left: 0px;height: 100vh;
  48. background-color: rgba(0,0,0,0.7);
  49. font-size: 14px;
  50. }
  51. .modalhtml .modal{
  52. background-color: #fff;
  53. border-radius: 10px;;
  54. top:28vh;
  55. width: 80vw;
  56. left: 10vw;
  57. position: fixed;
  58. border: 1px #ddd solid;
  59. }
  60. .modalhtml .modal .title{
  61. text-align: center;
  62. height: 35px;
  63. line-height: 35px;
  64. color: #000;;
  65. font-size: 16px;;
  66. font-weight: 600;
  67. margin-top: 5px;;
  68. }
  69. .modalhtml .modal .content{
  70. padding: 5px 10px;
  71. max-height: 160px;;
  72. min-height: 30px;
  73. line-height: 30px;;
  74. overflow-y: scroll;
  75. font-size: 14px;
  76. }
  77. .modalhtml .modal .btns{
  78. text-align: center;
  79. height: 40px;
  80. line-height: 40px;
  81. color: #3388ff;;
  82. font-size: 14px;;
  83. border-top: #ddd 1px solid;
  84. display: table;
  85. width: 100%;
  86. table-layout: fixed;
  87. }
  88. .modalhtml .modal .btns .ok{
  89. display: table-cell;
  90. font-weight: 600;
  91. }
  92. .modalhtml .modal .btns .cancel{
  93. color:#666;
  94. display: table-cell;
  95. width: calc(50% - 1px);
  96. border-right: #ddd solid 1px;
  97. }
  98. </style>