Click on tooltip content vuetify

三世轮回 提交于 2021-01-27 18:26:37

问题


everybody ! I have a question, is possible to click on the tooltip content for call any function ? When my tooltip is open i want to click on the span for call test function.

<template>
    <v-tooltip v-model="show" open-on-click :open-on-hover="false" bottom close-delay="2000">
      <template v-slot:activator="{ on }">
        {{on}}
        <v-btn color="primary" dark v-on="on" fab x-small class="btn">
          <v-icon>mdi-pencil</v-icon>
        </v-btn>
      </template>
        <span @click="test">click<span>

    </v-tooltip>
</template>

<script>
export default {
  data() {
    return {
      show: false
    };
  },
  methods: {
    test: function() {
     console.log('helloo')
    }
  }
};
</script>

回答1:


You need to overide tooltips styling. Add this styles.

.v-tooltip__content {
  pointer-events: initial;
}

here is codepen



来源:https://stackoverflow.com/questions/60549488/click-on-tooltip-content-vuetify

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!