Skip to content

[Component] [cascader] cascader级联选择器的expandTrigger设置为hover时无法选中选项 #21992

@d-250

Description

@d-250

Bug Type: Component

Environment

  • Vue Version: 3.5.13
  • Element Plus Version: 2.11.0
  • Browser / OS: Chrome 139.0.7258.155(正式版本) (64 位)
  • Build Tool: Vite

Reproduction

Related Component

  • el-cascader

Reproduction Link

Docs

Steps to reproduce

cascader级联选择器的expandTrigger设置为hover时无法选中选项,expandTrigger为click时没有问题
我试了三个版本2.11.1和2.11.0和2.10.7,问题出现在2.11.0及以上版本
文档中的也是同样的效果 https://element-plus.org/zh-CN/component/cascader.html#%E5%9F%BA%E7%A1%80%E7%94%A8%E6%B3%95

<template>
    <el-cascader
      v-model="value"
      :options="options"
      :props="props"
    />
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const value = ref([])

const props = {
  expandTrigger: 'hover' as const,
}

const options = [
  {
    value: '1',
    label: '1',
    children: [
      {
        value: '1-1',
        label: '1-1',
        children: [
          {
            value: '1-1-1',
            label: '1-1-1',
          },
          {
            value: '1-1-2',
            label: '1-1-2',
          },
          {
            value: '1-1-3',
            label: '1-1-3',
          }
        ]
      },
      {
        value: '1-2',
        label: '1-2',
        children: [
          {
            value: '1-2-1',
            label: '1-2-1',
          },
          {
            value: '1-2-2',
            label: '1-2-2',
          }
        ]
      }
    ]
  },{
    value: '2',
    label: '2',
    children: [
      {
        value: '2-1',
        label: '2-1',
        children: [
          {
            value: '2-1-1',
            label: '2-1-1',
          },
          {
            value: '2-1-2',
            label: '2-1-2',
          }
        ]
      }
    ]
  }
]
</script>

What is Expected?

点击选项后,v-model的值应为选项的value,输入框为选项的label

What is actually happening?

点击选项后v-model的值和输入框都为空

Additional comments

(empty)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions