|  |  |  | 
|---|
|  |  |  | @go-pay="emit('goPay', $event)" | 
|---|
|  |  |  | @paySuccess="emit('paySuccess', $event)" | 
|---|
|  |  |  | @missName="emit('missName', $event)" | 
|---|
|  |  |  | @editUserAccount="emit('editUserAccount', $event)" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script setup lang="ts"> | 
|---|
|  |  |  | import { computed, provide } from 'vue'; | 
|---|
|  |  |  | import { computed, provide, watch } from 'vue'; | 
|---|
|  |  |  | import { useStepper } from 'senin-mini/hooks'; | 
|---|
|  |  |  | import { ElectricBillRechargeContextKey } from './context'; | 
|---|
|  |  |  | import ElectricBillRechargeStep1 from './ElectricBillRechargeStep1.vue'; | 
|---|
|  |  |  | 
|---|
|  |  |  | isDev: false, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const stepperInfo = useStepper(['step1', 'step2'], 'step2'); | 
|---|
|  |  |  | const current = computed(() => stepperInfo.current.value); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const emit = defineEmits<{ | 
|---|
|  |  |  | (e: 'goPay', orderNo: string): void; | 
|---|
|  |  |  | (e: 'paySuccess', orderNo: string): void; | 
|---|
|  |  |  | (e: 'missName', userAccountId: string): void; | 
|---|
|  |  |  | (e: 'editUserAccount', userAccountId: string): void; | 
|---|
|  |  |  | (e: 'currentChange', current: 'step1' | 'step2'): void; | 
|---|
|  |  |  | }>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const stepperInfo = useStepper(['step1', 'step2'], 'step2'); | 
|---|
|  |  |  | const current = computed(() => stepperInfo.current.value); | 
|---|
|  |  |  | watch( | 
|---|
|  |  |  | current, | 
|---|
|  |  |  | (newVal) => { | 
|---|
|  |  |  | emit('currentChange', newVal); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | immediate: true, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | provide(ElectricBillRechargeContextKey, { | 
|---|
|  |  |  | ...stepperInfo, | 
|---|