Last active
November 3, 2018 22:16
-
-
Save BlackMix/dbc7df528f29f5cb5367aa8fe9e2dcde to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<slot></slot> | |
<div class="modal" :class="{ 'is-active': getModal }"> | |
<div class="modal-background"></div> | |
<div class="modal-content"> | |
<div class="box"> | |
<h1>Teste</h1> | |
</div> | |
</div> | |
<button class="modal-close is-large" aria-label="close"></button> | |
</div> | |
</div> | |
</template> | |
<script> | |
import { mapGetters } from 'vuex' | |
export default { | |
name: "RegisterModal", | |
data () { | |
return { | |
active: false | |
} | |
}, | |
computed: { | |
...mapGetters(['getModal']) | |
} | |
} | |
</script> | |
<style scoped lang="scss"> | |
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Vuex from 'vuex' | |
Vue.use(Vuex); | |
const SET_MODAL = 'SET_MODAL' | |
export default new Vuex.Store({ | |
state: { | |
showRegisterModal: false | |
}, | |
mutations: { | |
[SET_MODAL] (state, data) { | |
state.showRegisterModal = !data | |
} | |
}, | |
actions: { | |
setModal ({commit}, data) { | |
commit(SET_MODAL, data) | |
} | |
}, | |
getters: { | |
getModal (state) { | |
return state.showRegisterModal | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment