1
0
mirror of synced 2025-12-08 22:58:56 +08:00

重构组件

This commit is contained in:
xuliangzhan
2024-05-27 13:56:36 +08:00
parent cd78a392aa
commit 30b64fb0d7
4 changed files with 25 additions and 35 deletions

View File

@@ -3433,7 +3433,7 @@ export default defineComponent({
},
openTooltip (target, content) {
const $commTip = refCommTooltip.value
if ($commTip) {
if ($commTip && $commTip.open) {
return $commTip.open(target, content)
}
return nextTick()
@@ -3452,11 +3452,11 @@ export default defineComponent({
content: null,
visible: false
})
if ($tooltip) {
if ($tooltip && $tooltip.close) {
$tooltip.close()
}
}
if ($commTip) {
if ($commTip && $commTip.close) {
$commTip.close()
}
return nextTick()
@@ -5028,7 +5028,7 @@ export default defineComponent({
if (isClear) {
tableMethods.closeTooltip()
} else {
if ($tooltip) {
if ($tooltip && $tooltip.setActived) {
$tooltip.setActived(true)
}
}
@@ -5058,7 +5058,7 @@ export default defineComponent({
})
nextTick(() => {
const $tooltip = refTooltip.value
if ($tooltip) {
if ($tooltip && $tooltip.open) {
$tooltip.open(isCellOverflow ? overflowElem : (tipElem || overflowElem), formatText(content))
}
})
@@ -5710,7 +5710,7 @@ export default defineComponent({
// tooltipStore.currOpts = { content: null }
nextTick(() => {
const $tooltip = refTooltip.value
if ($tooltip) {
if ($tooltip && $tooltip.open) {
$tooltip.open(evnt.currentTarget, content)
}
})
@@ -5780,13 +5780,13 @@ export default defineComponent({
handleTargetLeaveEvent () {
const tooltipOpts = computeTooltipOpts.value
let $tooltip = refTooltip.value
if ($tooltip) {
if ($tooltip && $tooltip.setActived) {
$tooltip.setActived(false)
}
if (tooltipOpts.enterable) {
internalData.tooltipTimeout = setTimeout(() => {
$tooltip = refTooltip.value
if ($tooltip && !$tooltip.isActived()) {
if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
tableMethods.closeTooltip()
}
}, tooltipOpts.leaveDelay)

View File

@@ -1,6 +1,7 @@
import { VxeUI, setConfig, setIcon, VxeGlobalConfig, log } from '@vxe-ui/core'
import { VxeUI, setConfig, setIcon } from '@vxe-ui/core'
VxeUI.tableVersion = process.env.VUE_APP_VXE_TABLE_VERSION as string
VxeUI.version = process.env.VUE_APP_VXE_VERSION as string
VxeUI.tableVersion = process.env.VUE_APP_VXE_VERSION as string
setConfig({
emptyCell: ' ',
@@ -228,18 +229,18 @@ setIcon({
TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE: iconPrefix + 'fixed-right-fill'
})
export function config (options?: VxeGlobalConfig) {
log.warn('vxe.error.delFunc', ['config', 'setConfig'])
return setConfig(options)
}
export function setup (options?: VxeGlobalConfig) {
log.warn('vxe.error.delFunc', ['setup', 'setConfig'])
return setConfig(options)
}
// 兼容老版本
/**
* 已废弃,兼容老版本
* @deprecated
*/
export const VXETable = VxeUI
/**
* 已废弃
* @deprecated
*/
export const globalStore = VxeUI.globalStore || {}
VxeUI.globalStore = globalStore
export * from '@vxe-ui/core'
export default VxeUI