@RozmarinUS
YII2, PHP, React, TypeScript, Python hater

Как получить нижнюю позицию элемента при наведении?

<svg @mouseleave="onHideTooltip" class="availability-time-line-graphic" height="34"
                 preserveAspectRatio="none"
                 viewBox="0 0 448 34">
                  <rect
                    :fill="item.color"
                    :x="index*5" @mouseenter="onGetData(component_index, index)"
                    class="uptime-day component-11 day-0" data-html="true" height="34"
                    v-for="(item, index) in component.days" width="3"
                    y="0" />
 </svg>

methods: {
      onGetData(component, index, position) {
        let arr = this.components[component].days[index];
        this.tooltip = true;
        this.activeDay = arr.date;
        this.currentRect = "";
      },

      onHideTooltip() {
        this.tooltip = false;
      },
}
  • Вопрос задан
  • 88 просмотров
Решения вопроса 1
0xD34F
@0xD34F Куратор тега Vue.js
@mouseenter="onGetData(component_index, index, $event)"

methods: {
  onGetData(component_index, index, e) {
    const { bottom } = e.target.getBoundingClientRect();
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы