dialog2.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <CzrDialog
  3. :show="show"
  4. title="默认弹窗"
  5. @onClose="$emit('update:show', false)"
  6. width="1000px"
  7. height="auto"
  8. maxHeight="80%"
  9. :loading="state.loading"
  10. :show-submit="false"
  11. >
  12. <div class="__normal-form">
  13. <el-button @click="() => state.length++">新增一行</el-button>
  14. <el-button @click="() => state.length--">删除一行</el-button>
  15. <template v-for="(item, index) in state.length">
  16. <h1>{{ index }}</h1>
  17. </template>
  18. </div>
  19. </CzrDialog>
  20. </template>
  21. <script setup lang="ts">
  22. import {
  23. computed,
  24. getCurrentInstance,
  25. nextTick,
  26. reactive,
  27. ref,
  28. watch,
  29. } from 'vue'
  30. import { ElMessage, ElMessageBox } from 'element-plus'
  31. const emit = defineEmits(['update:show', 'refresh'])
  32. const { proxy } = getCurrentInstance()
  33. const props = defineProps({
  34. show: { default: false },
  35. transfer: {},
  36. })
  37. const state: any = reactive({
  38. loading: false,
  39. form: {},
  40. length: 10,
  41. })
  42. const ref_form = ref()
  43. watch(
  44. () => props.show,
  45. (n) => {},
  46. )
  47. </script>
  48. <style lang="scss" scoped></style>