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

fix: basemodal 无法透传 attributes 至 Modal.tsx #3637

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

DesignHhuang
Copy link
Contributor

General

fix: basemodal 无法透传 attributes 至 Modal.tsx.
close #3636

可以在 <script setup> 中使用 useAttrs() API 来访问一个组件的所有透传 attribute 。 如果没有使用 <script setup>,attrs 会作为 setup() 上下文对象的一个属性暴露,这边修改了透传 attribute 的方式。

  • Pull request template structure not broken

Type

ℹ️ What types of changes does your code introduce?

👉 Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)

@wangjue666 wangjue666 self-requested a review March 2, 2024 02:06
@jinmao88
Copy link
Collaborator

jinmao88 commented Mar 3, 2024

setup里解构了attrs 为什么还要useAttrs

@DesignHhuang
Copy link
Contributor Author

setup里解构了attrs 为什么还要useAttrs

嗯,这里就是去掉了useAttrs( ) 。<script setup>中使用useAttrs( ),这边没有用<script setup>写法,用的是 setup() 写法,所以直接用上下文中的 attrs 。

@jinmao88 jinmao88 merged commit 89830ec into vbenjs:main Mar 4, 2024
2 checks passed
xxs3315 pushed a commit to xxs3315/vue-vben-admin that referenced this pull request Mar 7, 2024
@vbenjs vbenjs locked and limited conversation to collaborators Aug 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BasicModal 无法透传 Attributes 至 Modal 组件
2 participants