mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
- Pivot support implementation - Rename queries into inquiries - Rename editor into workspace - Change result set format - New JSON format for inquiries - Redesign panels
38 lines
878 B
JavaScript
38 lines
878 B
JavaScript
export default {
|
|
data () {
|
|
return {
|
|
tooltipStyle: {
|
|
visibility: 'hidden'
|
|
}
|
|
}
|
|
},
|
|
computed: {
|
|
tooltipElement () {
|
|
return this.$refs.tooltip
|
|
}
|
|
},
|
|
methods: {
|
|
showTooltip (e, tooltipPosition) {
|
|
const position = tooltipPosition ? tooltipPosition.split('-') : ['top', 'right']
|
|
const offset = 12
|
|
|
|
if (position[0] === 'top') {
|
|
this.tooltipStyle.top = e.clientY - offset + 'px'
|
|
} else {
|
|
this.tooltipStyle.top = e.clientY + offset + 'px'
|
|
}
|
|
|
|
if (position[1] === 'right') {
|
|
this.tooltipStyle.left = e.clientX + offset + 'px'
|
|
} else {
|
|
this.tooltipStyle.left = e.clientX - offset - this.tooltipElement.offsetWidth + 'px'
|
|
}
|
|
|
|
this.tooltipStyle.visibility = 'visible'
|
|
},
|
|
hideTooltip () {
|
|
this.tooltipStyle.visibility = 'hidden'
|
|
}
|
|
}
|
|
}
|