customization-content.vue 2.6 KB

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