Skip to content

el-dropdown样式报错 ​

报错信息 ​

Popper: Detected CSS transitions on at least one of the following CSS properties: "transform", "top", "right", "bottom", "left". 

 Disable the "computeStyles" modifier's `adaptive` option to allow for smooth transitions, or remove these properties from the CSS transition declaration on the popper element if only transitioning opacity or background-color for example. 

 We recommend using the popper element as a wrapper around an inner element that can have any CSS property transitioned for animations.

原因 ​

这是因为el-dropdown内部使用了popper

解决办法 ​

给el-dropdown加上popper-options属性

html
<el-dropdown :popper-options="{ modifiers: [{ name: 'computeStyles', options: { adaptive: false } }] }">
</el-dropdown>

如有转载或 CV 的请标注本站原文地址