Skip to content

手动引入select组件,<a-select-option>的label没有正确展示 #6563

@Ocean-Liang

Description

@Ocean-Liang
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.20

Environment

"vue": "^3.2.47", "ant-design-vue": "^3.2.20",

Reproduction link

Edit on CodeSandbox

Steps to reproduce

手动引入select组件,并使用来设置选项

<template>
  <a-select>
    <a-select-option value="jack">Jack</a-select-option>
    <a-select-option value="lucy">Lucy</a-select-option>
  </a-select>
</template>

<script setup lang="ts">
import ASelect from "ant-design-vue/lib/select";
import "ant-design-vue/lib/select/style/index.css";
</script>

What is expected?

手动引入select组件的方式下,下拉的选项能正确地展示(上面的例子,下拉选项要显示成首字母大写的Jack和Lucy)

What is actually happening?

下拉的选项错误地显示成了value值,即jack和lucy,而不是Jack和Lucy

select-option-bug


本意是基于select组件封装一个较复杂的组件,并发布到npm。考虑到按需加载,故想采用手动引入的方式引入select组件。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions