feat: 更新 PSelect 组件,添加 value 插槽支持,优化选项加载和输入交互体验
All checks were successful
/ test (push) Successful in 27s
/ surge (push) Successful in 37s

This commit is contained in:
严浩
2024-12-06 16:21:41 +08:00
parent c4afb0342e
commit 9b78830313
3 changed files with 28 additions and 5 deletions

View File

@ -4,7 +4,7 @@ import AllCustom from './all-custom/all-custom.vue';
import TutorialForm from './tutorial-form/index.vue';
import ZodForm from './zod-form/index.vue';
const selectedCity = ref();
const selectedCity = ref('NY');
const loading = ref(false);
const cities = ref([
{ name: 'New York', code: 'NY' },
@ -53,6 +53,12 @@ const handleE = (eventName: string) => {
@change="(e) => handleE('change')(e)"
@blur="(e) => handleE('blur')(e)"
></Select>
<Select
:options="cities"
class="w-full md:w-56"
>
<template #value="slotProps">{{ slotProps.value }}</template>
</Select>
<Button
id="load-selected-city"
label="Load Selected City"