customization-content.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <kk-button text @click="dialogTableVisible = true">
  3. open a Table nested Dialog
  4. </kk-button>
  5. <kk-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. </kk-dialog>
  12. <!-- Form -->
  13. <kk-button text @click="dialogFormVisible = true">
  14. open a Form nested Dialog
  15. </kk-button>
  16. <kk-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. <kk-button @click="dialogFormVisible = false">Cancel</kk-button>
  31. <kk-button type="primary" @click="dialogFormVisible = false">
  32. Confirm
  33. </kk-button>
  34. </span>
  35. </template>
  36. </kk-dialog>
  37. </template>
  38. <script lang="ts" setup>
  39. import { reactive, ref } from 'vue'
  40. import { KkButton, KkDialog } from 'kankan-components'
  41. const dialogTableVisible = ref(false)
  42. const dialogFormVisible = ref(false)
  43. const formLabelWidth = '140px'
  44. const form = reactive({
  45. name: '',
  46. region: '',
  47. date1: '',
  48. date2: '',
  49. delivery: false,
  50. type: [],
  51. resource: '',
  52. desc: '',
  53. })
  54. const gridData = [
  55. {
  56. date: '2016-05-02',
  57. name: 'John Smith',
  58. address: 'No.1518, Jinshajiang Road, Putuo District',
  59. },
  60. {
  61. date: '2016-05-04',
  62. name: 'John Smith',
  63. address: 'No.1518, Jinshajiang Road, Putuo District',
  64. },
  65. {
  66. date: '2016-05-01',
  67. name: 'John Smith',
  68. address: 'No.1518, Jinshajiang Road, Putuo District',
  69. },
  70. {
  71. date: '2016-05-03',
  72. name: 'John Smith',
  73. address: 'No.1518, Jinshajiang Road, Putuo District',
  74. },
  75. ]
  76. </script>
  77. <style scoped>
  78. .kk-button--text {
  79. margin-right: 15px;
  80. }
  81. .el-select {
  82. width: 300px;
  83. }
  84. .el-input {
  85. width: 300px;
  86. }
  87. .dialog-footer button:first-child {
  88. margin-right: 10px;
  89. }
  90. </style>