Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[新功能需求] 希望select-picker 支持远程搜索,自定义展示格式(slot,包括选择时的显示radio、checkbox) #862

Open
qzsiniong opened this issue Jan 21, 2025 · 0 comments
Labels
feature: need confirm 待确认的新特性

Comments

@qzsiniong
Copy link

qzsiniong commented Jan 21, 2025

这个功能解决了什么问题?

1、远程搜索很常见
2、显示格式可能不是纯文本

Image

你期望的 API 是什么样子的?

const list = ref([]);
const loading = ref(false);
const filterVal = ref('');

async function handleSearch(word: string) {
    const { items } = await $http.get('/xxx', {
      params: { word },
    });

    list.value = items;
}
<wd-select-picker v-model:filterVal="filterVal" filterable filter-mode="remote" @search="handleSearch" :columns="list" :loading="loading">
   <template #item="{ item }">
      <view class="text-left">
        <text style="font-weight: bold">{{ item.user_name }}</text>
        <text>({{ item.employee?.emp_no }})</text>
        <wd-divider vertical />
        <text>{{ item.employee?.position?.parameter_desc ?? '-未知职位-' }}</text>
        <wd-divider vertical />
        <text>{{ item.employee?.dept?.dept_name ?? '-未知部门-' }}</text>
        <wd-divider vertical />
        <text>{{ item.employee?.dept?.dept_name ?? '-未知部门-' }}</text>
        <wd-divider vertical />
        <text>{{ item.employee?.dept?.dept_name ?? '-未知部门-' }}</text>
      </view>
    </template>
</wd-select-picker>
@qzsiniong qzsiniong added the feature: need confirm 待确认的新特性 label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: need confirm 待确认的新特性
Projects
None yet
Development

No branches or pull requests

1 participant