Mar 15, 2018
0
Level 33
Best way to disable tab state
Hi,
I'm working within a spark project where I've to customize some things. I
I've made my own tab-state that looks like this insettings.js:
var base = require('settings/settings');
Vue.component('spark-settings', {
mixins: [base],
data() {
return {
menu: {
profile: true,
security: false,
subscription: false,
invoices: false
}
}
},
methods: {
changeTab(tab) {
for (let item in this.menu) {
if (this.menu.hasOwnProperty(item)) {
this.menu[item] = false;
}
}
this.menu[tab] = true;
}
}
});
However when I look in settings.js from spark that looks like this:
module.exports = {
props: ['user', 'teams'],
/**
* Load mixins for the component.
*/
mixins: [require('./../mixins/tab-state')],
/**
* The component's data.
*/
data() {
return {
billableType: 'user',
team: null
};
},
/**
* Prepare the component.
*/
mounted() {
this.usePushStateForTabs('.spark-settings-tabs');
}
};
It's loading tab-state from a mixin. Obviously I can comment it out but then I'm changing within the core of spark. Is there no other way?
Please or to participate in this conversation.