I am looking at the tutorials on vues page for adding tooltips. https://vuetifyjs.com/en/components/tooltips
It seems to work fine for an individual button.
However, it does not work within a v-item. I get a console message saying
'[Vuetify] v-item is missing a default scopedSlot'
<v-item v-for="foo in bars" :key=`${foo}`>
<v-tooltip>
<v-btn slot="activator">
<v-icon>some-icon</v-icon>
</v-btn>
<span>Some tooltip text</span>
</v-tooltip>
</v-item>
I've tried adding things to the above code like slot="activator" to v-item and slot-scope="activator" to the v-btn, but nothing seems to work quite right. Any suggestions as to what I'm doing wrong?
Running snippet added by @BoussadjraBrahim :
new Vue({
el: '#app',
data() {
return {
bars: ['a', 'b', 'c']
}
}
})
<script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css">
<div id="app">
<v-item-group>
<v-container grid-list-md>
<v-layout wrap>
<v-flex v-for="(n,i) in bars" :key="n" xs12 md4>
<v-item>
<v-tooltip>
<v-btn slot="activator">
<v-icon>home</v-icon>
</v-btn>
<span>Some tooltip text {{n}}</span>
</v-tooltip>
</v-item>
</v-flex>
</v-layout>
</v-container>
</v-item-group>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…