Skip to content

Commit c89eb92

Browse files
docs: ✏️ 修复 Tooltip 文档显示异常的问题
1 parent fc3d7ad commit c89eb92

2 files changed

Lines changed: 22 additions & 32 deletions

File tree

docs/component/tooltip.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,16 @@ const control = () => {
148148

149149
## Tooltip Attributes
150150

151-
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
152-
| ------------- | ------------------------------------------ | -------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
153-
| show | 状态是否可见 | boolean | - | false | - |
154-
| content | 显示的内容,也可以通过 `slot#content` 传入 | string / array | - | - | - |
155-
| placement | Tooltip 的出现位置 | string | top / top-start / top-end / bottom / bottom-start / bottom-end / left / left-start / left-end / right / right-start / right-end | bottom | - |
156-
| disabled | Tooltip 是否可用 | boolean | - | false | - |
157-
| visible-arrow | 是否显示 Tooltip 箭头 | boolean | - | true | - |
158-
| offset | 出现位置的偏移量 | number | number[] | {x:0, y:0} | - | 0 | 1.3.12 |
159-
| show-close | 是否显示 Tooltip 内部的关闭按钮 | boolean | - | false | - |
151+
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
152+
|---------------|--------------------------------------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------|--------------|----------|
153+
| show | 状态是否可见 | boolean | - | false | - |
154+
| content | 显示的内容,也可以通过 `slot#content` 传入 | string / array | - | - | - |
155+
| placement | Tooltip 的出现位置 | string | top / top-start / top-end / bottom / bottom-start / bottom-end / left / left-start / left-end / right / right-start / right-end | bottom | - |
156+
| disabled | Tooltip 是否可用 | boolean | - | false | - |
157+
| visible-arrow | 是否显示 Tooltip 箭头 | boolean | - | true | - |
158+
| offset | 出现位置的偏移量 | number / number[] | - | `{x:0, y:0}` | 1.3.12 |
159+
| show-close | 是否显示 Tooltip 内部的关闭按钮 | boolean | - | false | - |
160+
160161

161162
## Events
162163

src/pages/tooltip/Index.vue

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
22
<page-wraper>
3-
<wd-toast />
4-
<view style="overflow: hidden" @click.stop="closeOutside">
3+
<view style="overflow: hidden" class="page-tooltip" @click.stop="closeOutside">
54
<demo-block title="基本用法">
65
<view class="top">
76
<wd-tooltip placement="bottom-start" content="bottom-start 提示文字" @change="handleChange1">
@@ -74,10 +73,10 @@
7473
</demo-block>
7574
<demo-block title="控制显隐">
7675
<view @click.stop="control">
77-
<wd-button plain size="small" class="button-control">{{ show15 ? '关闭' : '打开' }}</wd-button>
76+
<wd-button plain size="small" class="button-control">{{ show ? '关闭' : '打开' }}</wd-button>
7877
</view>
7978
<view class="demo-left demo-control">
80-
<wd-tooltip placement="top" content="控制显隐" v-model="show15">
79+
<wd-tooltip placement="top" content="控制显隐" v-model="show">
8180
<wd-button :round="false">top</wd-button>
8281
</wd-tooltip>
8382
</view>
@@ -103,32 +102,15 @@
103102
import { useToast, useQueue } from '@/uni_modules/wot-design-uni'
104103
import { ref } from 'vue'
105104
106-
const show1 = ref<boolean>(false)
107-
const show2 = ref<boolean>(false)
108-
const show3 = ref<boolean>(false)
109-
const show4 = ref<boolean>(false)
110-
const show5 = ref<boolean>(false)
111-
const show6 = ref<boolean>(false)
112-
const show7 = ref<boolean>(false)
113-
const show8 = ref<boolean>(false)
114-
const show9 = ref<boolean>(false)
115-
const show10 = ref<boolean>(false)
116-
const show11 = ref<boolean>(false)
117-
const show12 = ref<boolean>(false)
118-
const show13 = ref<boolean>(false)
119-
const show14 = ref<boolean>(false)
120-
const show15 = ref<boolean>(false)
121-
const show16 = ref<boolean>(false)
122-
const show17 = ref<boolean>(false)
105+
const show = ref<boolean>(false)
123106
const content = ref<string>('显示内容')
124107
125108
const toast = useToast()
126109
127110
const { closeOutside } = useQueue()
128111
129112
function control() {
130-
show15.value = !show15.value
131-
// this.setData({ show15: !this.data.show15 })
113+
show.value = !show.value
132114
}
133115
function onShow() {
134116
console.log('显示')
@@ -189,6 +171,13 @@ function handleChange17(event: any) {
189171
}
190172
</script>
191173
<style lang="scss" scoped>
174+
.page-tooltip {
175+
:deep() {
176+
.wd-button {
177+
min-width: auto;
178+
}
179+
}
180+
}
192181
.position-wrap {
193182
position: relative;
194183
}

0 commit comments

Comments
 (0)