问题
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