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组件 label-in-value 属性会让浏览器崩溃 #3216

Closed
1 task
cff-github opened this issue Nov 19, 2020 · 4 comments
Closed
1 task

select组件 label-in-value 属性会让浏览器崩溃 #3216

cff-github opened this issue Nov 19, 2020 · 4 comments
Assignees
Labels

Comments

@cff-github
Copy link

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

Version

2.0.0-rc.1

Environment

none

Reproduction link

Steps to reproduce

none

What is expected?

希望能回到跟以前版本一样

What is actually happening?

浏览器崩溃

@yunlongduan
Copy link

官网都能卡死

@kiuyaku
Copy link

kiuyaku commented Nov 19, 2020

vue报错是说因为组件递归的问题? 搞得我好久才发现是这个属性存在问题。。。晕死了

@tangjinzhou tangjinzhou self-assigned this Nov 19, 2020
@tangjinzhou
Copy link
Member

下个版本修复
临时方案:
添加 option-label-prop="label" 以及 label

<template>
  <a-select v-model:value="value" option-label-prop="label" label-in-value style="width: 120px" @change="handleChange">
    <a-select-option value="jack" label="Jack (100)">
      Jack (100)
    </a-select-option>
    <a-select-option value="lucy" label="Lucy (101)">
      Lucy (101)
    </a-select-option>
  </a-select>
</template>
<script>
export default {
  data() {
    return {
      value: { key: 'lucy' },
    };
  },
  methods: {
    handleChange(value) {
      console.log(value); // { key: "lucy", label: "Lucy (101)" }
    },
  },
};
</script>

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants