From 94aef5d1ed4ec20d39e61b71fecfd7f969c12ffb Mon Sep 17 00:00:00 2001 From: dopamine Date: Tue, 29 Jul 2025 20:21:46 +0800 Subject: [PATCH] wip --- packages/components/select/src/select.vue | 5 ++++- packages/components/select/src/type.ts | 13 ++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/components/select/src/select.vue b/packages/components/select/src/select.vue index 4e3b5c64cf..b66bffaea1 100644 --- a/packages/components/select/src/select.vue +++ b/packages/components/select/src/select.vue @@ -323,13 +323,14 @@ import ElTag from '@element-plus/components/tag' import ElIcon from '@element-plus/components/icon' import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants' import { flattedChildren, isArray, isObject } from '@element-plus/utils' -import { useCalcInputWidth } from '@element-plus/hooks' +import { useCalcInputWidth, useOrderedChildren } from '@element-plus/hooks' import ElOption from './option.vue' import ElSelectMenu from './select-dropdown.vue' import { useSelect } from './useSelect' import { selectKey } from './token' import ElOptions from './options' import { selectProps } from './select' +import { COMPONENT_NAME as OPTION_COMPONET_NAME } from './option' import type { VNode } from 'vue'; import type { SelectContext } from './type' @@ -362,6 +363,8 @@ export default defineComponent({ setup(props, { emit, slots }) { const instance = getCurrentInstance()! + const { } = useOrderedChildren(instance, ) + instance.appContext.config.warnHandler = (...args) => { // Overrides warnings about slots not being executable outside of a render function. // We call slot below just to simulate data when persist is false, this warning message should be ignored diff --git a/packages/components/select/src/type.ts b/packages/components/select/src/type.ts index 8904fb41c7..a8573322be 100644 --- a/packages/components/select/src/type.ts +++ b/packages/components/select/src/type.ts @@ -4,14 +4,12 @@ import type { ComputedRef, ExtractPropTypes, Ref, + VNode, __ExtractPublicPropTypes, } from 'vue' import type { SelectProps } from './select' import type { optionProps } from './option' -export interface SelectGroupContext { - disabled: boolean -} export interface SelectContext { props: SelectProps states: SelectStates @@ -37,6 +35,15 @@ export type SelectStates = { menuVisibleOnFocus: boolean isBeforeHide: boolean } + +export interface SelectGroupContext { + disabled: boolean +} + +export type OptionContext = { + uid: number + getVnode: () => VNode +} export type OptionProps = ExtractPropTypes export type OptionPropsPublic = __ExtractPublicPropTypes export interface OptionStates {