|
@@ -101,24 +101,26 @@ function dealDomBoundary(el, direction) {
|
|
|
const allPlacements = ['left', 'bottom', 'right', 'top']
|
|
|
|
|
|
|
|
|
-function getElStyleAttr(element, attr) {
|
|
|
- const styles = window.getComputedStyle(element)
|
|
|
- // @ts-ignore
|
|
|
- return styles[attr]
|
|
|
-}
|
|
|
+// function getElStyleAttr(element, attr) {
|
|
|
+// const styles = window.getComputedStyle(element)
|
|
|
+// return styles[attr]
|
|
|
+// }
|
|
|
|
|
|
const isOverflow = (target) => {
|
|
|
const scrollWidth = target.scrollWidth
|
|
|
const offsetWidth = target.offsetWidth
|
|
|
- const range = document.createRange()
|
|
|
- range.setStart(target, 0)
|
|
|
- range.setEnd(target, target.childNodes.length)
|
|
|
- const rangeWidth = range.getBoundingClientRect().width
|
|
|
- const padding = (parseInt(getElStyleAttr(target, 'paddingLeft'), 10) || 0) + (parseInt(getElStyleAttr(target, 'paddingRight'), 10) || 0)
|
|
|
- return (rangeWidth + padding > target.offsetWidth) || scrollWidth > offsetWidth
|
|
|
+ // const range = document.createRange()
|
|
|
+ // range.setStart(target, 0)
|
|
|
+ // range.setEnd(target, target.childNodes.length)
|
|
|
+ // const rangeWidth = range.getBoundingClientRect().width
|
|
|
+ // const padding = (parseInt(getElStyleAttr(target, 'paddingLeft'), 10) || 0) + (parseInt(getElStyleAttr(target, 'paddingRight'), 10) || 0)
|
|
|
+ // return (rangeWidth + padding > target.offsetWidth) || scrollWidth > offsetWidth
|
|
|
+ return scrollWidth > offsetWidth
|
|
|
}
|
|
|
|
|
|
-export const ellipsisTooltip = localStorage.getItem('useEllipseTooltip') ? {
|
|
|
+const closeTooltip = false
|
|
|
+
|
|
|
+export const ellipsisTooltip = closeTooltip ? {} : {
|
|
|
mounted(el, binding) {
|
|
|
//获取指令的参数
|
|
|
const {
|
|
@@ -186,4 +188,4 @@ export const ellipsisTooltip = localStorage.getItem('useEllipseTooltip') ? {
|
|
|
}
|
|
|
window.removeEventListener('scroll', el._scrollHandler)
|
|
|
}
|
|
|
-} : {}
|
|
|
+}
|