addBm.vue 856 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <component :is="activeComponent" ref="acRef" :modelId="modelId" @success="emit('success')"/>
  3. <div class="btn-layout">
  4. <el-button type="primary" @click="handleNext">下一步</el-button>
  5. </div>
  6. </template>
  7. <script setup lang="ts">
  8. import step1 from "./step1.vue"
  9. const {proxy,emit} = getCurrentInstance()
  10. const activeComponent = ref(step1);
  11. const acRef=ref(null)
  12. const modelId = ref(null)
  13. function handleNext() {
  14. proxy.$refs['acRef'].submitForm()
  15. }
  16. function editRow(row){
  17. modelId.value = null
  18. if(row){
  19. modelId.value = row.modelId
  20. }
  21. activeComponent.value = step1
  22. proxy.$refs['acRef'].handleUpdate(row)
  23. }
  24. defineExpose({editRow})
  25. </script>
  26. <style scoped lang="scss">
  27. .btn-layout{
  28. display: flex;
  29. justify-content: center;
  30. border-top:1px solid #e1e1e180;
  31. padding-top:10px;
  32. margin:10px -20px;
  33. }
  34. </style>