移動端 tootips的截圖
移動端 gif演示
移動端的 tooltips:
1. 移動端ios沒有hover事件,需要用touchstart的來代替,採用的方案 添加 ontouchstart
的事件
2. 自定義的上下左右的 不同的位置
具體代碼:
tooltips 封裝好的組件
<style lang="scss" scoped>
// $bg: rgba(#3078e7, 0.9);
.tooltip {
position: relative;
display: inline-block;
}
.ques {
width: 0.38rem;
height: 0.38rem;
}
.tooltiptextExtend {
visibility: hidden;
max-width: 7rem;
// min-width: 2rem;
display: block;
// background-color: $bg;
color: #fff;
text-align: center;
border-radius: 0.1rem;
padding: 0.1rem;
po