|
|
@@ -1,4 +1,4 @@
|
|
|
-import { computed, reactive, readonly, ref } from 'vue'
|
|
|
+import { computed, reactive, readonly } from 'vue'
|
|
|
|
|
|
export interface TopupPackage {
|
|
|
id: string | number
|
|
|
@@ -27,11 +27,6 @@ export interface TopupPopupOptions {
|
|
|
defaultPackageId?: TopupPackage['id']
|
|
|
/** Default selected method id */
|
|
|
defaultMethodId?: TopupPaymentMethod['id']
|
|
|
- /**
|
|
|
- * Confirm callback
|
|
|
- * Will be called when user clicks the confirm button.
|
|
|
- */
|
|
|
- onConfirm?: (payload: TopupPopupResult) => void
|
|
|
}
|
|
|
|
|
|
export interface TopupPopupState {
|
|
|
@@ -53,8 +48,6 @@ const state = reactive<TopupPopupState>({
|
|
|
selectedMethodId: null,
|
|
|
})
|
|
|
|
|
|
-const confirmHandler = ref<((payload: TopupPopupResult) => void) | null>(null)
|
|
|
-
|
|
|
const selectedPackage = computed(() =>
|
|
|
state.packages.find(item => item.id === state.selectedPackageId) ?? null,
|
|
|
)
|
|
|
@@ -76,8 +69,6 @@ const open = (options?: TopupPopupOptions) => {
|
|
|
|
|
|
state.selectedPackageId = defaultPackageId
|
|
|
state.selectedMethodId = defaultMethodId
|
|
|
-
|
|
|
- confirmHandler.value = options.onConfirm ?? null
|
|
|
}
|
|
|
|
|
|
state.visible = true
|