Refactor #4351 - For Dock
parent
3e59aa18b9
commit
340e6a82e5
|
@ -23,6 +23,11 @@ import DockSub from './DockSub.vue';
|
|||
export default {
|
||||
name: 'Dock',
|
||||
extends: BaseDock,
|
||||
beforeMount() {
|
||||
if (!this.$slots.item) {
|
||||
console.warn('In future versions, vue-router support will be removed. Item templating should be used.');
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
containerClass() {
|
||||
return [this.class, this.cx('root')];
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
<component v-else :is="templates['icon']" :item="processedItem" :class="cx('icon')"></component>
|
||||
</a>
|
||||
</template>
|
||||
<component v-else :is="templates['item']" :item="processedItem" :index="index"></component>
|
||||
<component v-else :is="templates['item']" :item="processedItem" :index="index" :label="processedItem.label" :props="getMenuItemProps(processedItem, index)"></component>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
|
@ -275,6 +275,24 @@ export default {
|
|||
},
|
||||
disabled(item) {
|
||||
return typeof item.disabled === 'function' ? item.disabled() : item.disabled;
|
||||
},
|
||||
getMenuItemProps(item, index) {
|
||||
return {
|
||||
action: mergeProps(
|
||||
{
|
||||
tabindex: -1,
|
||||
'aria-hidden': true,
|
||||
class: this.cx('action')
|
||||
},
|
||||
this.getPTOptions('action', item, index)
|
||||
),
|
||||
icon: mergeProps(
|
||||
{
|
||||
class: [this.cx('icon'), item.icon]
|
||||
},
|
||||
this.getPTOptions('icon', item, index)
|
||||
)
|
||||
};
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
Loading…
Reference in New Issue