Compare commits

...

3 Commits

Author SHA1 Message Date
neverland
ef8331bd23
docs(changelog): vant@2.12.54 (#11567) 2023-02-11 22:16:27 +08:00
chenjiahan
dfe0769b97 chore: release 2.12.54 2023-02-11 22:13:01 +08:00
acyza
97391aaa30
fix(popover): location update after transition (#11558)
* fix(popover): location update

* update
2023-02-11 22:11:01 +08:00
4 changed files with 30 additions and 3 deletions

View File

@ -16,6 +16,15 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
## Details
### [v2.12.54](https://github.com/vant-ui/vant/compare/v2.12.53...v2.12.54)
`2023-02-11`
**Bug Fixes**
- Popover: location update after transition [#11558](https://github.com/vant-ui/vant/issues/11558)
- Search: @search-left-icon-color var not work [#11299](https://github.com/vant-ui/vant/issues/11299)
### [v2.12.53](https://github.com/vant-ui/vant/compare/v2.12.52...v2.12.53)
`2022-11-17`

View File

@ -25,6 +25,15 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
## 更新内容
### [v2.12.54](https://github.com/vant-ui/vant/compare/v2.12.53...v2.12.54)
`2023-02-11`
**Bug Fixes**
- Popover: 修复过渡动画后位置错误的问题 [#11558](https://github.com/vant-ui/vant/issues/11558)
- Search: 修复 @search-left-icon-color 样式变量不生效的问题 [#11299](https://github.com/vant-ui/vant/issues/11299)
### [v2.12.53](https://github.com/vant-ui/vant/compare/v2.12.52...v2.12.53)
`2022-11-17`

View File

@ -1,6 +1,6 @@
{
"name": "vant",
"version": "2.12.53",
"version": "2.12.54",
"description": "Mobile UI Components built on Vue",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -1,5 +1,5 @@
import { createPopper, offsetModifier } from '@vant/popperjs';
import { createNamespace } from '../utils';
import { createNamespace, isServer } from '../utils';
import { BORDER_BOTTOM } from '../utils/constant';
// Mixins
@ -60,6 +60,10 @@ export default createComponent({
beforeDestroy() {
if (this.popper) {
if (!isServer) {
window.removeEventListener('animationend', this.updateLocation);
window.removeEventListener('transitionend', this.updateLocation);
}
this.popper.destroy();
this.popper = null;
}
@ -67,7 +71,7 @@ export default createComponent({
methods: {
createPopper() {
return createPopper(this.$refs.wrapper, this.$refs.popover.$el, {
const popper = createPopper(this.$refs.wrapper, this.$refs.popover.$el, {
placement: this.placement,
modifiers: [
{
@ -85,6 +89,11 @@ export default createComponent({
},
],
});
if (!isServer) {
window.addEventListener('animationend', this.updateLocation);
window.addEventListener('transitionend', this.updateLocation);
}
return popper;
},
updateLocation() {