20 lines
490 B
JavaScript
20 lines
490 B
JavaScript
import TOGGLE_SIDEBAR from '@/graphql/gql/local/mutations/toggleSidebar.gql';
|
|
|
|
export default {
|
|
methods: {
|
|
openSidebar(type) {
|
|
this.$nextTick(() => {
|
|
// we don't want this to happen instantly, only almost instantly. Otherwise the click-outside-directive won't work
|
|
this.$apollo.mutate({
|
|
mutation: TOGGLE_SIDEBAR,
|
|
variables: {
|
|
sidebar: {
|
|
[type]: true,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
},
|
|
},
|
|
};
|