DetailPageModal.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div v-if="modalFlag">
  3. <div class="vehicle_servies_modal" @mousewheel="mousewheel">
  4. <div class="modal_content">
  5. <div class="input">
  6. <p>版块名称</p>
  7. <input type="text" v-model="platName" />
  8. </div>
  9. <div class="btn">
  10. <button @click="submit" style="margin: 0">保存</button>
  11. <button @click="hideModal" style="margin: 0">取消</button>
  12. </div>
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. props: {
  20. modalFlag: {
  21. type: Boolean,
  22. default: false,
  23. },
  24. },
  25. data() {
  26. return {
  27. platName: "",
  28. };
  29. },
  30. methods: {
  31. submit: function () {
  32. if (this.platName) {
  33. this.$emit("submit", this.platName);
  34. } else {
  35. alert('请输入版块名称');
  36. }
  37. },
  38. hideModal: function () {
  39. this.$emit("hide_modal");
  40. },
  41. mousewheel: function (e) {
  42. e.preventDefault();
  43. },
  44. },
  45. };
  46. </script>
  47. <style scoped lang="less">
  48. .vehicle_servies_modal {
  49. position: fixed;
  50. left: 0;
  51. top: 0;
  52. height: 100vh;
  53. width: 100vw;
  54. background-color: rgba(127, 127, 127, 0.7);
  55. display: flex;
  56. justify-content: center;
  57. align-items: center;
  58. .modal_content {
  59. width: 600px;
  60. height: 300px;
  61. background-color: #fff;
  62. transform: translateY(-50px);
  63. .input {
  64. width: 280px;
  65. margin: 0 auto;
  66. margin-top: 80px;
  67. display: flex;
  68. height: 28px;
  69. p {
  70. width: 80px;
  71. height: 28px;
  72. line-height: 28px;
  73. }
  74. input {
  75. width: 200px;
  76. border: 1px solid #555;
  77. }
  78. }
  79. .btn {
  80. padding-left: 80px;
  81. margin: 0 auto;
  82. width: 200px;
  83. margin-top: 30px;
  84. display: flex;
  85. justify-content: space-between;
  86. button {
  87. margin: 0!;
  88. }
  89. }
  90. }
  91. }
  92. </style>