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(form): Collpsed in FormItemGi does not work #1166

Merged
merged 2 commits into from
Sep 15, 2021

Conversation

LYErin
Copy link
Contributor

@LYErin LYErin commented Sep 13, 2021

close #1160

@vercel
Copy link

vercel bot commented Sep 13, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tusimple/naive-ui/7S3wkCSnsDp9RJfxzVfUesQ8ovAG
✅ Preview: https://naive-ui-git-fork-lyerin-fix-collpsed-in-formitemgi-tusimple.vercel.app

@codecov
Copy link

codecov bot commented Sep 13, 2021

Codecov Report

Merging #1166 (afc0b1b) into main (78449db) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1166      +/-   ##
==========================================
- Coverage   49.77%   49.77%   -0.01%     
==========================================
  Files         514      514              
  Lines       12718    12720       +2     
  Branches     3601     3601              
==========================================
  Hits         6331     6331              
- Misses       5298     5300       +2     
  Partials     1089     1089              
Impacted Files Coverage Δ
src/form/src/FormItemGridItem.ts 11.76% <0.00%> (-1.57%) ⬇️
src/grid/src/GridItem.tsx 77.77% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78449db...afc0b1b. Read the comment docs.

src/grid/src/GridItem.tsx Show resolved Hide resolved
return h(NGridItem, keep(this.$props, gridItemPropKeys), {
const self = getCurrentInstance()
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const gridItemProps = self!.vnode.props as GridItemVNodeProps
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几行得写到 setup里面么

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

写在这个位置看起来没啥毛病。

不过也是有问题的,就是说把 formItemProps 也传给 gridItemProps 了,得想办法改一下。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self!.vnode.props 打印出来是不包含formItemProps的, 只有GridItemVNodeProps定义的几个类型值

@07akioni 07akioni merged commit c11edb2 into tusen-ai:main Sep 15, 2021
@07akioni
Copy link
Collaborator

07akioni commented Sep 15, 2021

@LYErin 看一看修正之后的实现 c1e2946

主要是 FormItemGi 的 render 开始那两行

@LYErin LYErin deleted the fix-collpsed-in-formItemGi branch September 20, 2021 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grid嵌套FormItemGi时collapsed属性不会响应式更新
3 participants