Skip to content

Commit

Permalink
style: 优化注释 👑👑👑
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Feb 24, 2023
1 parent 9e06e09 commit cb661fc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
English | [Chinese](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.md)

## 0.26.0 (2023-02-24)

- Optimize `f-back-top` component implementation
- `f-menu` component adds `on-menu item click` `on-submenu-click` configuration item
- Fix the `f-menu` component folding problem
- Refactoring the `f-collapse-animation` component

## 0.25.1 (2023-02-21)

- Fix the `f-submenu` component class name problem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
* 以往版本实现可参考:
*
* @see collapse-animation https://github.com/FightingDesign/fighting-design/tree/474f6f19c2b034d5f2839c110e02b8987af24a9a/packages/fighting-design/collapse-animation
*
* 新版本使用 Transition 来实现
*
* @see javascript-hooks https://cn.vuejs.org/guide/built-ins/transition.html#javascript-hooks
*/
/** 获取当前的展示状态 */
Expand Down Expand Up @@ -78,13 +82,27 @@
el.style.height = `${el.scrollHeight}px`
}
/**
* 在离开过渡开始时调用
*
* 用这个来开始离开动画
*
* @param { Object } el 元素节点
*/
const onLeave = (el: HTMLElement): void => {
if (el.scrollHeight !== 0) {
el.style.transition = transitionStyle
el.style.height = '0'
}
}
/**
* 在离开过渡完成
*
* 且元素已从 DOM 中移除时调用
*
* @param { Object } el 元素节点
*/
const onAfterLeave = (el: HTMLElement): void => {
el.style.transition = ''
el.style.height = ''
Expand Down

0 comments on commit cb661fc

Please sign in to comment.