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] 明明有数据,但是select组件的下拉菜单就是不显示 #799

Closed
arieslee opened this issue May 17, 2022 · 8 comments
Closed

Comments

@arieslee
Copy link

arieslee commented May 17, 2022

tdesign-vue-next 版本

0.14.2

重现链接

https://stackblitz.com/edit/angular-peryga?file=src/demo.vue

重现步骤

相关代码:

<template>
    <div class="icd-remote">
        <t-select v-model="data" filterable placeholder="请输入搜索" :keys="{ value: 'code', label: 'title' }" :options="options" :loading="loading" @change="onChange" reserve-keyword @search="remoteMethod" />
    </div>
</template>

<script setup lang="ts">
import { ref, toRefs } from 'vue';
import { IApiResponse } from '@/utils/types';
import { searchIcdList } from '@/api/icd';

const loading = ref(false);
const options = ref([]);
const props = defineProps({
    data: {
        type: String,
        default() {
            return null;
        },
    },
});
const { data } = toRefs(props);
const emit = defineEmits(['update:data']);
const remoteMethod = async (search) => {
    try {
        loading.value = true;
        const res: IApiResponse = await searchIcdList({ kw: search });
        if (res.code === 0) {
            options.value = res.data.data_list;
        } else {
            return Promise.reject(new Error(res.message));
        }
    } catch (e) {
        console.log(e);
    } finally {
        loading.value = false;
    }
};
const onChange = (v) => {
    emit('update:data', v);
};
</script>

searchIdcList的返回结果

{
    "code": 0,
    "message": "",
    "data": {
        "data_list": [
            {
                "id": 288946540875799,
                "code": "E22.002",
                "title": "生长激素生成过多",
                "help_code": "SZJSSCGD"
            },
            {
                "id": 288946540826662,
                "code": "E54  02",
                "title": "维生素C缺乏(抗坏血酸缺乏)",
                "help_code": "WSSCQFKHXSQF"
            },
            {
                "id": 288946540818464,
                "code": "E24.002",
                "title": "促肾上腺皮质激素生成过多",
                "help_code": "CSSXPZJSSCGD"
            },
            {
                "id": 288946540699693,
                "code": "M8833/3",
                "title": "色素沉着性隆凸性皮肤纤维肉瘤",
                "help_code": "SSCZXLTXPF"
            },
            {
                "id": 288946540613681,
                "code": "T81.017",
                "title": "手术操作后创面出血",
                "help_code": "SSCZHCMCX"
            },
            {
                "id": 288946540613639,
                "code": "T79.101",
                "title": "脂肪拴塞(创伤性)",
                "help_code": "ZFSSCSX"
            },
            {
                "id": 288946540441608,
                "code": "Q20.101",
                "title": "先天性右心室双出口",
                "help_code": "XTXYXSSCK"
            },
            {
                "id": 288946540371979,
                "code": "Q85.801",
                "title": "普-杰二氏综合征(遗传性色素沉着消化",
                "help_code": "PJESZHZYCXSSC"
            },
            {
                "id": 288946540306459,
                "code": "L81.901",
                "title": "皮肤色素沉着",
                "help_code": "PFSSCZ"
            },
            {
                "id": 288946540249096,
                "code": "H20.803",
                "title": "眼色素层脑膜炎",
                "help_code": "YSSCNMY"
            },
            {
                "id": 288946540216326,
                "code": "G60.803",
                "title": "色素沉着,水肿,多发性神经病综合征",
                "help_code": "SSCZSZDFXSJB"
            }
        ]
    }
}

期望结果

No response

实际结果

image

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

@github-actions
Copy link
Contributor

👋 @arieslee,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2022

♥️ 有劳 @xkelvinx666 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @arieslee

@PengYYYYY
Copy link
Collaborator

升级到0.14.2看看呢

@arieslee
Copy link
Author

arieslee commented May 17, 2022

升级到0.14.2看看呢

哦,刚才升级了0.14.2也是同样的问题 @PengYYYYY

@arieslee
Copy link
Author

@xkelvinx666

@PengYYYYY
Copy link
Collaborator

正在修复中,预期本周五修复

@arieslee
Copy link
Author

哦,我以为没有人管这个了呢,不好意思

@PengYYYYY
Copy link
Collaborator

0.15.2 已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants