Skip to content

基本使用

vue

<template>
  <zeroTooltip content="提示内容" trigger="click" position="top">
    <zero-button>点击方式</zero-button>
    <template #content></template>
  </zeroTooltip>
</template>

鼠标移入展示

vue

<template>
  <zeroTooltip content="提示内容" trigger="mouseenter" position="top">
    <zero-button>鼠标移入</zero-button>
    <template #content>显示插槽内容</template>
  </zeroTooltip>
</template>

属性

属性名说明可选值默认值类型
content展示的内容--String
placement展示位置'top', 'right', 'bottom', 'left'topString
trigger触发方式click, mouseenterclickString
visible是否显示-falseBoolean

插槽

插槽名说明
defaultTooltip 触发 & 引用的元素
content自定义内容

导出

名称类型说明
togglePopperFunction打开和关闭tooltip方法