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(popover): Fixed extra 4px margin that appears when title is empty #3104

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

briantang1117
Copy link

Types of changes

  • New feature
  • Bug fix
  • Enhancement
  • Component style change
  • Typescript definition change
  • Documentation change
  • Coding style change
  • Refactoring
  • Test cases
  • Continuous integration
  • Breaking change
  • Others

Background and context

修复popover组件的title属性以及slot为空时出现的4px下变局

Solution

判断有无 title 属性和 title slot,如果均没有则隐藏整个 title div

How is the change tested?

截屏2024-04-26 12 15 16
截屏2024-04-26 12 15 12

Changelog

Component Changelog(CN) Changelog(EN) Related issues
popover 修复没有 title 为空时边距问题 Fixed an issue where there was no space time margin for title

Checklist:

  • Test suite passes (npm run test)
  • Provide changelog for relevant changes (e.g. bug fixes and new features) if applicable.
  • Changes are submitted to the appropriate branch (e.g. features should be submitted to feature branch and others
    should be submitted to main branch)

Other information

Copy link

codesandbox bot commented Apr 26, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@flsion flsion self-assigned this May 9, 2024
@flsion flsion added the type: 🐞 bug Something isn't working label May 9, 2024
@@ -17,7 +17,7 @@
>
<slot />
<template #content>
<div :class="`${prefixCls}-title`">
<div v-if="title || titleSlot" :class="`${prefixCls}-title`">
Copy link
Member

Choose a reason for hiding this comment

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

arco vue 最初依赖的 vue 3.1 版本还不支持 useSlots,这里从兼容性考虑,可以更换为 v-if="title || $slots.title"

Copy link
Author

Choose a reason for hiding this comment

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

已经按照要求修改,上次提交忘记提交了样式文件,抱歉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants