forked from opentiny/tiny-vue
feat(cascader): 增加级联面板的tooltip功能 (#3665)
This commit is contained in:
parent
d2f7dfdd84
commit
5b66478454
|
|
@ -12,6 +12,7 @@
|
||||||
"//postversion": "pnpm build"
|
"//postversion": "pnpm build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@opentiny/vue-directive": "workspace:~",
|
||||||
"@opentiny/utils": "workspace:~",
|
"@opentiny/utils": "workspace:~",
|
||||||
"@opentiny/vue-checkbox": "workspace:~",
|
"@opentiny/vue-checkbox": "workspace:~",
|
||||||
"@opentiny/vue-common": "workspace:~",
|
"@opentiny/vue-common": "workspace:~",
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,14 @@ import Radio from '@opentiny/vue-radio'
|
||||||
import { isEqual } from '@opentiny/utils'
|
import { isEqual } from '@opentiny/utils'
|
||||||
import { iconLoadingShadow, iconChevronRight, iconYes } from '@opentiny/vue-icon'
|
import { iconLoadingShadow, iconChevronRight, iconYes } from '@opentiny/vue-icon'
|
||||||
import type { PropType } from '@opentiny/vue-common'
|
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 { ICascaderNodeApi, ICascaderNodeRenderlessParams } from '@opentiny/vue-renderless/types/cascader-node.type'
|
||||||
import type { ICascaderPanelNode } from '@opentiny/vue-renderless/types/cascader-panel.type'
|
import type { ICascaderPanelNode } from '@opentiny/vue-renderless/types/cascader-panel.type'
|
||||||
import '@opentiny/vue-theme/cascader-node/index.less'
|
import '@opentiny/vue-theme/cascader-node/index.less'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: $prefix + 'CascaderNode',
|
name: $prefix + 'CascaderNode',
|
||||||
|
directives: { AutoTip },
|
||||||
components: {
|
components: {
|
||||||
TinyCheckbox: Checkbox,
|
TinyCheckbox: Checkbox,
|
||||||
TinyRadio: Radio,
|
TinyRadio: Radio,
|
||||||
|
|
@ -120,7 +122,11 @@ export default defineComponent({
|
||||||
const vnode = render ? render({ node, data: node.data }) : null
|
const vnode = render ? render({ node, data: node.data }) : null
|
||||||
|
|
||||||
// 可用 state.nodeLabel 简化
|
// 可用 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
|
const { state } = this
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue