<template>
    <component :is="activeComponent" ref="acRef" :modelId="modelId" @success="emit('success')"/>
    <div class="btn-layout">
      <el-button type="primary" @click="handleNext">下一步</el-button>
    </div>
</template>
<script setup lang="ts">
import step1 from "./step1.vue"
const {proxy,emit} = getCurrentInstance()
const activeComponent = ref(step1);
const acRef=ref(null)
const modelId = ref(null)

function handleNext() {
  proxy.$refs['acRef'].submitForm()
}

function editRow(row){
  modelId.value = null
  if(row){
    modelId.value = row.modelId
  }
  activeComponent.value = step1
  proxy.$refs['acRef'].handleUpdate(row)
}

defineExpose({editRow})

</script>
<style scoped lang="scss">
.btn-layout{
  display: flex;
  justify-content: center;
  border-top:1px solid #e1e1e180;
  padding-top:10px;
  margin:10px -20px;
}
</style>

