Fixed #1490 - Add tooltipOptions property to Dock

pull/1533/head
mertsincan 2021-08-31 14:28:46 +03:00
parent a89c51bc71
commit aeba88374b
3 changed files with 7 additions and 4 deletions

View File

@ -6,6 +6,7 @@ interface DockProps {
class?: string; class?: string;
style?: any; style?: any;
exact?: boolean; exact?: boolean;
tooltipOptions?: any;
} }
declare class Dock { declare class Dock {

View File

@ -1,6 +1,6 @@
<template> <template>
<div :class="containerClass" :style="style"> <div :class="containerClass" :style="style">
<DockSub :model="model" :template="$slots.item" :exact="exact"></DockSub> <DockSub :model="model" :template="$slots.item" :exact="exact" :tooltipOptions="tooltipOptions"></DockSub>
</div> </div>
</template> </template>
@ -17,6 +17,7 @@ export default {
model: null, model: null,
class: null, class: null,
style: null, style: null,
tooltipOptions: null,
exact: { exact: {
type: Boolean, type: Boolean,
default: true default: true

View File

@ -5,7 +5,7 @@
<template v-if="!template"> <template v-if="!template">
<router-link v-if="item.to && !disabled(item)" :to="item.to" custom v-slot="{navigate, href, isActive, isExactActive}"> <router-link v-if="item.to && !disabled(item)" :to="item.to" custom v-slot="{navigate, href, isActive, isExactActive}">
<a :href="href" role="menuitem" :class="linkClass(item, {isActive, isExactActive})" :target="item.target" <a :href="href" role="menuitem" :class="linkClass(item, {isActive, isExactActive})" :target="item.target"
:data-pr-tooltip="item.label" @click="onItemClick($event, item, navigate)"> v-tooltip:[tooltipOptions]="{value: item.label, disabled: !tooltipOptions}" @click="onItemClick($event, item, navigate)">
<template v-if="typeof item.icon === 'string'"> <template v-if="typeof item.icon === 'string'">
<span :class="['p-dock-action-icon', item.icon]" v-ripple></span> <span :class="['p-dock-action-icon', item.icon]" v-ripple></span>
</template> </template>
@ -13,7 +13,7 @@
</a> </a>
</router-link> </router-link>
<a v-else :href="item.url" role="menuitem" :class="linkClass(item)" :target="item.target" <a v-else :href="item.url" role="menuitem" :class="linkClass(item)" :target="item.target"
:data-pr-tooltip="item.label" @click="onItemClick($event, item)" :tabindex="disabled(item) ? null : '0'"> v-tooltip:[tooltipOptions]="{value: item.label, disabled: !tooltipOptions}" @click="onItemClick($event, item)" :tabindex="disabled(item) ? null : '0'">
<template v-if="typeof item.icon === 'string'"> <template v-if="typeof item.icon === 'string'">
<span :class="['p-dock-action-icon', item.icon]" v-ripple></span> <span :class="['p-dock-action-icon', item.icon]" v-ripple></span>
</template> </template>
@ -41,7 +41,8 @@ export default {
exact: { exact: {
type: Boolean, type: Boolean,
default: true default: true
} },
tooltipOptions: null
}, },
data() { data() {
return { return {