/
githubmirror
/
vuetify
Обзор
Документация
Войти
/
githubmirror
/
vuetify
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/docs/src/examples/v-tooltip/usage.vue
56 строк
1 KB
santarosalia
docs(VTooltip): fix usage example button text (#20379)
27 авг 2024, 16:18
Не верифицирован
27 авг 2024, 16:18
9737e4a
Код
Авторство
О чём код?
<template> <ExamplesUsageExample v-model="model" :code="code" :name="name" :options="options" > <div class="text-center"> <v-tooltip v-bind="props"> <template v-slot:activator="{ props: activatorProps }"> <v-btn v-bind="activatorProps">Hover Over Me</v-btn> </template> {{ text }} </v-tooltip> </div> <template v-slot:configuration> <v-text-field v-model="text" label="Text"></v-text-field> <v-checkbox v-model="active" label="Always show"></v-checkbox> </template> </ExamplesUsageExample> </template> <script setup> const name = 'v-tooltip' const model = ref('default') const text = ref('Tooltip') const active = ref() const options = [] const props = computed(() => { const props = { text: text.value || undefined, } if (active.value) { props['model-value'] = true props['onUpdate:model-value'] = true } return props }) const slots = computed(() => { return ` <template v-slot:activator="{ props }"> <v-btn v-bind="props">Hover Over Me</v-btn> </template> ` }) const code = computed(() => { return `<${name}${propsToString(props.value)}>${slots.value}</${name}>` }) </script>