为调整button的位置,为el-button添加了margin-left样式,但是发现按钮无法点击了。
原因:
margin-left属于浮动样式,其他的浮动样式包括float,position等。浮动样式图层跟标准页面不在同一个层面上,因此无法点击。
解决:
在el-button @click的事件后边加上 .native 事件修饰符,
同时添加position: relative;设置为相对定位。
el-button添加浮动样式后点击无效
于 2022-12-07 17:16:06 首次发布