From c24cdd854e258712408a7904bdb401c49e3f07c1 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 28 八月 2025 13:09:08 +0800
Subject: [PATCH] fix: 修改通道充值提示语
---
packages/components/src/components/Input/ChooseInputWithPicker.vue | 52 ++++++++++++++++++----------------------------------
1 files changed, 18 insertions(+), 34 deletions(-)
diff --git a/packages/components/src/components/Input/ChooseInputWithPicker.vue b/packages/components/src/components/Input/ChooseInputWithPicker.vue
index bd57273..83fe7c2 100644
--- a/packages/components/src/components/Input/ChooseInputWithPicker.vue
+++ b/packages/components/src/components/Input/ChooseInputWithPicker.vue
@@ -1,13 +1,20 @@
<template>
- <ChooseInput :modelValue="inputValue" @click="handleOpen()"></ChooseInput>
+ <ChooseInput :modelValue="inputValue" @click="handleOpen()" v-bind="$attrs"></ChooseInput>
+ <Popup v-model:visible="popupVisible" position="bottom">
+ <Picker
+ :modelValue="[modelValue]"
+ :columns="options"
+ @cancel="popupVisible = false"
+ @confirm="handleConfirm"
+ ></Picker>
+ </Popup>
</template>
<script setup lang="ts">
import ChooseInput from './ChooseInput.vue';
import { Popup, Picker } from '@nutui/nutui-taro';
import { convertOptions, ValueEnum } from 'senin-mini/utils';
-import { Portal } from 'senin-mini/components';
-import { computed, h } from 'vue';
+import { computed, ref } from 'vue';
defineOptions({
name: 'ChooseInputWithPicker',
@@ -37,37 +44,14 @@
() => options.value?.find((x) => x.value === props.modelValue)?.text ?? ''
);
+const popupVisible = ref(false);
+
+function handleConfirm({ selectedValue, selectedOptions }) {
+ emit('update:modelValue', selectedOptions[0].value);
+ popupVisible.value = false;
+}
+
function handleOpen() {
- const _modelValue = [props.modelValue];
- Portal.add((key) => {
- return h(
- Portal.Container,
- { keyNumber: key, delayOpen: true },
- {
- default: ({ open, onClose }) =>
- h(
- Popup,
- {
- visible: open.value,
- 'onUpdate:visible': (value) => !value && onClose(),
- position: 'bottom',
- },
- {
- default: () =>
- h(Picker, {
- modelValue: _modelValue,
- columns: options.value,
- onCancel: onClose,
- onConfirm: ({ selectedValue, selectedOptions }) => {
- console.log('selectedValue: ', selectedValue, selectedOptions);
- emit('update:modelValue', selectedOptions[0].value);
- onClose();
- },
- }),
- }
- ),
- }
- );
- });
+ popupVisible.value = true;
}
</script>
--
Gitblit v1.9.1