feat(cascader): 增加级联面板的tooltip功能 (#3665)

This commit is contained in:
chenxi-20 2025-08-26 14:39:46 +08:00 committed by GitHub
parent d2f7dfdd84
commit 5b66478454
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -12,6 +12,7 @@
"//postversion": "pnpm build"
},
"dependencies": {
"@opentiny/vue-directive": "workspace:~",
"@opentiny/utils": "workspace:~",
"@opentiny/vue-checkbox": "workspace:~",
"@opentiny/vue-common": "workspace:~",

View File

@ -17,12 +17,14 @@ import Radio from '@opentiny/vue-radio'
import { isEqual } from '@opentiny/utils'
import { iconLoadingShadow, iconChevronRight, iconYes } from '@opentiny/vue-icon'
import type { PropType } from '@opentiny/vue-common'
import { AutoTip } from '@opentiny/vue-directive'
import type { ICascaderNodeApi, ICascaderNodeRenderlessParams } from '@opentiny/vue-renderless/types/cascader-node.type'
import type { ICascaderPanelNode } from '@opentiny/vue-renderless/types/cascader-panel.type'
import '@opentiny/vue-theme/cascader-node/index.less'
export default defineComponent({
name: $prefix + 'CascaderNode',
directives: { AutoTip },
components: {
TinyCheckbox: Checkbox,
TinyRadio: Radio,
@ -120,7 +122,11 @@ export default defineComponent({
const vnode = render ? render({ node, data: node.data }) : null
// state.nodeLabel
return <span class="tiny-cascader-node__label">{vnode || node.label}</span>
return (
<span class="tiny-cascader-node__label" v-auto-tip>
{vnode || node.label}
</span>
)
}
const { state } = this