问题
The code shows the tooltip icon but does not show anything when I hover on it.How do I enable it on hover like in the case of number below.
https://vuetifyjs.com/en/components/tooltips
<v-text-field label="Name" id="name" disabled>
<v-tooltip slot="append" :value="true" bottom>
<v-icon slot="activator" color="primary" dark>live_help</v-icon>
<span>Name of the user</span>
</v-tooltip>
</v-text-field>
<v-text-field label="number" id="number">
<v-tooltip slot="append" bottom>
<v-icon slot="activator" color="primary" dark>live_help</v-icon>
<span> Number of years</span>
</v-tooltip>
</v-text-field>
回答1:
Vuetify disables all pointer events for disabled input fields:
.v-input--is-disabled:not(.v-input--is-readonly) {
pointer-events: none;
}
Two ways to remove this:
- You add a custom class to this input where you say
pointer-events: auto
or - You pass the
readonly
prop to the component so that Vuetify addsv-input--is-readonly
class which removes thepointer-events: none
condition automatically.
So, your input definition becomes:
<v-text-field label="Name" id="name" disabled readonly>
<v-tooltip slot="append" :value="true" bottom>
<v-icon slot="activator" color="primary" dark>live_help</v-icon>
<span>Name of the user</span>
</v-tooltip>
</v-text-field>
来源:https://stackoverflow.com/questions/51826891/how-do-i-enable-tooltips-on-a-disabled-text-field-in-vuetify