tooltip 组件源码分享,主要从以下两个方面:
1、tooltip 组件页面结构。
2、tooltip 组件属性。
一、组件页面结构。
二、组件属性。
2.1 effect 默认提供的主题,类型为 string,可选值有 dark/light,默认 dark。
2.2 content 显示的内容,类型为 string,无默认值。
2.3 placement tooltip 出现的位置,类型为 string,可选值有 top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end,默认值为 bottom。
2.4 value / v-model 状态是否可见,类型为 boolean,默认 false。
2.5 disabled tooltip 是否可用,类型为 boolean,默认 false。
2.6 offset 出现位置的偏移量,类型为 number,默认 0。
2.7 transition 定义渐变动画,类型为 string,默认 el-fade-in-linear。
2.8 visible-arrow tooltip 是否显示箭头,类型为 boolean,默认 true。
2.9 popper-options popper.js 的参数,类型为 object,默认 { boundariesElement: 'body', gpuAcceleration: false }。
2.10 open-delay 延迟出现,单位毫秒,类型为 number,默认 0。
2.11 manual 手动控制模式,设置为 true 后,mouseenter 和 mouseleave 事件将不会生效,类型为 boolean,默认 false。
2.12 popper-class 为 Tooltip 的 popper 添加类名,类型 string,无默认值。
2.13 enterable 鼠标是否可进入到 tooltip 中,类型为 boolean,默认 true。
2.14 hide-after Tooltip 出现后自动隐藏延时,单位毫秒,为 0 则不会自动隐藏,类型为 number,默认 0。
2.15 tabindex tooltip 组件的 tabindex,类型为 number,默认为 0。