<el-cascader
  v-model="form.productCategoryId"
  @change="classifyChange"
  :options="classify"
  :props="{ 
    checkStrictly: true, 
    value: 'categoryId', 
    label: 'categoryName', 
    expandTrigger: 'hover',
    emitPath: false,
  }"
  clearable
  :show-all-levels='false'
  ref='classifyRef'
>
</el-cascader>

Define a ref
const classifyRef = ref()

inside setup

const classifyChange = () => {
  console.log(classifyRef.value)
  // 调用实例的方法手动关闭
  classifyRef.value.togglePopperVisible()
}

万年打野易大师
1.5k 声望1.1k 粉丝