Skip to content

Commit

Permalink
fix(select): 处理 group-option 下 style 和 class 的透传
Browse files Browse the repository at this point in the history
  • Loading branch information
skytt committed Aug 8, 2022
1 parent 0bf8923 commit 1c04591
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/select/hooks/useSelectOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default function useSelectOptions(props: TdSelectProps, context: SetupCon
if (isArray(res)) {
res.forEach((child) => {
groupOption.children.push({
// 单独处理 style 和 class 参数的透传
class: child.data.staticClass,
style: child.data.staticStyle,
// 透传其他常规参数
...child.componentOptions.propsData,
slots: () => child.componentOptions.children,
index: dynamicIndex,
Expand Down

0 comments on commit 1c04591

Please sign in to comment.