✨(component): [tooltip]新增 visible 参数;修复定位; content 变化时更新位置
This commit is contained in:
@@ -389,11 +389,11 @@ export default {
|
||||
| 属性 | 描述 | 类型 | 默认值 | 可选值 |
|
||||
| ------------------- | -------------------------------------------------- | ----------------------------------------- | -------- | ----------------------------- |
|
||||
| v-model | 当前激活 | `string` | - | - |
|
||||
| type | 主题样式 | `string` | - | - |
|
||||
| type | 主题样式 | `string` | - | `brief` `card` |
|
||||
| tabPosition | 位置 | `string` | `bottom` | `top` `bottom` `left` `right` |
|
||||
| allow-close | 允许关闭 | `boolean` | `false` | `true` `false` |
|
||||
| before-close | `Function`关闭之前的回调钩子函数 | 参数(`id`), `return false` 表示不进行关闭 | - | - |
|
||||
| before-leave | `Function`切换标签之前的回调钩子函数 | 参数(`id`), `return false` 表示不进行切换 | - | - |
|
||||
| before-close | 关闭之前的回调钩子函数,参数(`id`), `return false` 表示不进行关闭 | `Function` | - | - |
|
||||
| before-leave | 切换标签之前的回调钩子函数, 参数(`id`), `return false` 表示不进行关闭 | `Function` | - | - |
|
||||
| activeBarTransition | 是否开启 activeBar 动画,仅 brief 有效,默认 `false` | `boolean` | `false` | `true` `false` |
|
||||
|
||||
:::
|
||||
|
||||
@@ -48,9 +48,35 @@ setup() {
|
||||
<lay-button>tooltip</lay-button>
|
||||
</lay-tooltip>
|
||||
</template>
|
||||
:::
|
||||
|
||||
::: title 外部控制
|
||||
:::
|
||||
|
||||
::: demo
|
||||
<template>
|
||||
<lay-button @click="visible = !visible">{{visible ? '显示' : '隐藏'}}</lay-button>
|
||||
<div style="padding: 100px">
|
||||
<lay-tooltip position="right" content="时光都淡了,我还伴着你。" :visible="visible">
|
||||
<lay-button>tooltip</lay-button>
|
||||
</lay-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref,watch } from 'vue';
|
||||
export default {
|
||||
setup() {
|
||||
const visible = ref(false)
|
||||
return {
|
||||
visible,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
:::
|
||||
|
||||
::: title 显示位置
|
||||
|
||||
Reference in New Issue
Block a user