feat: 更新 PSelect 组件,添加 value 插槽支持,优化选项加载和输入交互体验
This commit is contained in:
@ -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"
|
||||
|
Reference in New Issue
Block a user