refactor: 优化控制台打印

This commit is contained in:
wangjiahao 2023-11-28 19:12:28 +08:00
parent 09f2a70173
commit 9d7227885f

View File

@ -878,12 +878,16 @@ export default {
//
getParentSize() {
if (this.parent === true) {
try {
const style = window.getComputedStyle(this.$el.parentNode, null)
const rect = this.$el.parentNode.getBoundingClientRect()
this.parentX = rect.x
this.parentY = rect.y
// 100000 60px
return [Math.round(parseFloat(style.getPropertyValue('width'), 10)) + 6, 100000]
} catch (e) {
console.warn('custom:getParentSize')
}
}
if (typeof this.parent === 'string') {
const parentNode = document.querySelector(this.parent)