Add locked property; display lock instead of tab number if tab is not unlocked.
This commit is contained in:
parent
eedceccd3d
commit
87fca05e77
|
@ -4,7 +4,10 @@
|
||||||
:class="[colorClasses, index < 5 && 'mr-px']"
|
:class="[colorClasses, index < 5 && 'mr-px']"
|
||||||
@click="$store.commit('setActiveTab', index)"
|
@click="$store.commit('setActiveTab', index)"
|
||||||
>
|
>
|
||||||
{{ tabData.label }}
|
<template v-if="!tabData.locked">{{ tabData.label }}</template>
|
||||||
|
<template v-if="tabData.locked"
|
||||||
|
><i class="fa fa-lock" aria-hidden="true"></i
|
||||||
|
></template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ export const state = () => ({
|
||||||
title: 'Instruments',
|
title: 'Instruments',
|
||||||
darkColor: 'yellow-600',
|
darkColor: 'yellow-600',
|
||||||
lightColor: 'yellow-200',
|
lightColor: 'yellow-200',
|
||||||
|
locked: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'upgrades',
|
id: 'upgrades',
|
||||||
|
@ -17,6 +18,7 @@ export const state = () => ({
|
||||||
title: 'Upgrades',
|
title: 'Upgrades',
|
||||||
darkColor: 'blue-600',
|
darkColor: 'blue-600',
|
||||||
lightColor: 'blue-200',
|
lightColor: 'blue-200',
|
||||||
|
locked: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'missions',
|
id: 'missions',
|
||||||
|
@ -24,6 +26,7 @@ export const state = () => ({
|
||||||
title: 'Missions',
|
title: 'Missions',
|
||||||
darkColor: 'violet-600',
|
darkColor: 'violet-600',
|
||||||
lightColor: 'violet-200',
|
lightColor: 'violet-200',
|
||||||
|
locked: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'timemachine',
|
id: 'timemachine',
|
||||||
|
@ -31,6 +34,7 @@ export const state = () => ({
|
||||||
title: 'Time Machine',
|
title: 'Time Machine',
|
||||||
darkColor: 'lime-600',
|
darkColor: 'lime-600',
|
||||||
lightColor: 'lime-200',
|
lightColor: 'lime-200',
|
||||||
|
locked: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'achievements',
|
id: 'achievements',
|
||||||
|
@ -38,6 +42,7 @@ export const state = () => ({
|
||||||
title: 'Time Magic',
|
title: 'Time Magic',
|
||||||
darkColor: 'orange-600',
|
darkColor: 'orange-600',
|
||||||
lightColor: 'orange-200',
|
lightColor: 'orange-200',
|
||||||
|
locked: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'prestige',
|
id: 'prestige',
|
||||||
|
@ -45,6 +50,7 @@ export const state = () => ({
|
||||||
title: 'Etc.',
|
title: 'Etc.',
|
||||||
darkColor: 'teal-600',
|
darkColor: 'teal-600',
|
||||||
lightColor: 'teal-200',
|
lightColor: 'teal-200',
|
||||||
|
locked: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
currency: new Decimal(0),
|
currency: new Decimal(0),
|
||||||
|
@ -131,6 +137,7 @@ export const getters = {
|
||||||
|
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
setActiveTab: (state, index) => {
|
setActiveTab: (state, index) => {
|
||||||
|
if (state.tabs[index].locked) return
|
||||||
state.activeTabIndex = index
|
state.activeTabIndex = index
|
||||||
},
|
},
|
||||||
addCurrency: (state, value) => {
|
addCurrency: (state, value) => {
|
||||||
|
|
Reference in New Issue