v1.2.0
Release notes
The next minor release of vue-collapsed
brings a lot of improvements and a new feature.
What's new
- Starting from v1.2.0 you don't need to define a class name with a height transition anymore. As long as no transition is defined on the Collapse element, the following one is automatically added:
height var(--vc-auto-duration) cubic-bezier(0.33, 1, 0.68, 1)
. - Added automatic transition disabling for
prefers-reduced-motion: reduce
and the ability to manually disable transitions via CSS.
What's changed
Callback props have been replaced by emits. This won't break any functionality, as Vue emits can also be defined using the previous props' syntax (onCollapsed
, onExpand
, etc).
If you were using them, you can update your code as displayed below.
Pre v1.2
<Collapse :when="isExpanded" :onExpand="callback">
<p>This is a paragraph.</p>
</Collapse>
v1.2
<Collapse :when="isExpanded" @expand="callback">
<p>This is a paragraph.</p>
</Collapse>
What's improved
- Collapse has been refactored from a render function to a Vue component, delegating the transformation to the Vue compiler. This brings proper support for typed emits and slots.
- Updated
vite-plugin-dts
configuration for better types generation