Skip to content

Commit

Permalink
Add disabled prop to tabItem
Browse files Browse the repository at this point in the history
  • Loading branch information
jtommy authored and wanxe committed Nov 12, 2017
1 parent dfb7c80 commit f4768bd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

* Vue 2.5+ is now the minimum required version
* **Removed** prompt dialog ``inputPlaceholder``, ``inputName`` and ``inputMaxlength`` props
* Add ``disabled`` prop to tabItem

## 0.5.4

Expand Down
7 changes: 7 additions & 0 deletions docs/pages/documentation/general/tabs/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ export default [
type: 'String',
values: '—',
default: '<code>mdi</code>'
},
{
name: '<code>disabled</code>',
description: 'Item is disabled',
type: 'Boolean',
values: '-',
default: 'false'
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
amet.
</b-tab-item>

<b-tab-item label="Videos">
<b-tab-item label="Videos" disabled>
Nunc nec velit nec libero vestibulum eleifend.
Curabitur pulvinar congue luctus.
Nullam hendrerit iaculis augue vitae ornare.
Expand Down
3 changes: 2 additions & 1 deletion src/components/tabs/TabItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
props: {
label: String,
icon: String,
iconPack: String
iconPack: String,
disabled: Boolean
},
data() {
return {
Expand Down
5 changes: 4 additions & 1 deletion src/components/tabs/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<ul>
<li v-for="(tabItem, index) in tabItems"
:key="index"
:class="{ 'is-active': newValue === index }">
:class="{
'is-active': newValue === index,
'is-disabled': tabItem.disabled
}">
<a @click="tabClick(index)">
<b-icon
v-if="tabItem.icon"
Expand Down
5 changes: 5 additions & 0 deletions src/scss/components/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
.tabs {
margin-bottom: 0;
}
.is-disabled {
pointer-events: none;
cursor: not-allowed;
opacity: 0.5;
}
.tab-content {
position: relative;
overflow: hidden;
Expand Down

0 comments on commit f4768bd

Please sign in to comment.