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

[Component] [select] select组件设置remote后,点击输入框就会触发remote-method #16607

Closed
brign123 opened this issue Apr 22, 2024 · 1 comment

Comments

@brign123
Copy link

Bug Type: Component

Environment

  • Vue Version: 3.4.23
  • Element Plus Version: 2.7.1
  • Browser / OS: Chrome/122.0.0.0
  • Build Tool: Other

Reproduction

Related Component

  • el-select

Reproduction Link

Element Plus Playground

Steps to reproduce

官方文档的说明是:remote-method为一个Function,它会在输入值发生变化时调用,参数为当前输入值。
但现在只要点击就会调用,想问下是不是有哪个配置可以控制?

What is Expected?

remote-method 在输入值变化时才调用

What is actually happening?

remote-method 每次都会调用

Additional comments

(empty)

@shulaoda
Copy link

remote-method 是符合预期的,它是用于做远程搜索用的,当你点击一下的时候值为空,是用来展示全部数据的。
并不是每次点击都会触发,而是你点击后会聚焦导致展示选择菜单,再次点击会隐藏,隐藏时并不会触发,将 remoteMethod 改为下面并在 el-select 上加上这个参数 remote-show-suffix ,然后重新体验一下。

  console.log('query',query)
  loading.value = true
  setTimeout(() => {
    loading.value = false
    options.value = list.value.filter((item) => {
      return item.label.toLowerCase().includes(query.toLowerCase())
    })
  }, 200)
}```

@chenxch chenxch closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
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

3 participants