customization-content.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <el-button text @click="dialogTableVisible = true">
  3. open a Table nested Dialog
  4. </el-button>
  5. <el-dialog v-model="dialogTableVisible" title="Shipping address">
  6. <el-table :data="gridData">
  7. <el-table-column property="date" label="Date" width="150" />
  8. <el-table-column property="name" label="Name" width="200" />
  9. <el-table-column property="address" label="Address" />
  10. </el-table>
  11. </el-dialog>
  12. <!-- Form -->
  13. <el-button text @click="dialogFormVisible = true">
  14. open a Form nested Dialog
  15. </el-button>
  16. <el-dialog v-model="dialogFormVisible" title="Shipping address">
  17. <el-form :model="form">
  18. <el-form-item label="Promotion name" :label-width="formLabelWidth">
  19. <el-input v-model="form.name" autocomplete="off" />
  20. </el-form-item>
  21. <el-form-item label="Zones" :label-width="formLabelWidth">
  22. <el-select v-model="form.region" placeholder="Please select a zone">
  23. <el-option label="Zone No.1" value="shanghai" />
  24. <el-option label="Zone No.2" value="beijing" />
  25. </el-select>
  26. </el-form-item>
  27. </el-form>
  28. <template #footer>
  29. <span class="dialog-footer">
  30. <el-button @click="dialogFormVisible = false">Cancel</el-button>
  31. <el-button type="primary" @click="dialogFormVisible = false">
  32. Confirm
  33. </el-button>
  34. </span>
  35. </template>
  36. </el-dialog>
  37. </template>
  38. <script lang="ts" setup>
  39. import { reactive, ref } from 'vue'
  40. const dialogTableVisible = ref(false)
  41. const dialogFormVisible = ref(false)
  42. const formLabelWidth = '140px'
  43. const form = reactive({
  44. name: '',
  45. region: '',
  46. date1: '',
  47. date2: '',
  48. delivery: false,
  49. type: [],
  50. resource: '',
  51. desc: '',
  52. })
  53. const gridData = [
  54. {
  55. date: '2016-05-02',
  56. name: 'John Smith',
  57. address: 'No.1518, Jinshajiang Road, Putuo District',
  58. },
  59. {
  60. date: '2016-05-04',
  61. name: 'John Smith',
  62. address: 'No.1518, Jinshajiang Road, Putuo District',
  63. },
  64. {
  65. date: '2016-05-01',
  66. name: 'John Smith',
  67. address: 'No.1518, Jinshajiang Road, Putuo District',
  68. },
  69. {
  70. date: '2016-05-03',
  71. name: 'John Smith',
  72. address: 'No.1518, Jinshajiang Road, Putuo District',
  73. },
  74. ]
  75. </script>
  76. <style scoped>
  77. .el-button--text {
  78. margin-right: 15px;
  79. }
  80. .el-select {
  81. width: 300px;
  82. }
  83. .el-input {
  84. width: 300px;
  85. }
  86. .dialog-footer button:first-child {
  87. margin-right: 10px;
  88. }
  89. </style>