improvemodal

This commit is contained in:
vincent 2019-05-10 20:41:33 +02:00
parent d5d869c738
commit 314d787fda
3 changed files with 20 additions and 14 deletions

View File

@ -73,8 +73,8 @@
</div> </div>
</div> </div>
</div> </div>
<modalLogin v-bind:class="{'is-active': showModalLogin}" @close="showModalLogin = false"/> <modalLogin v-bind:show="showModalLogin" @close="showModalLogin = false" />
<modal v-bind:class="{'is-active': showModal}" @close="showModal = false">{{modalmessage}}</modal> <modal v-bind:show="showModal" @close="showModal = false">{{modalmessage}}</modal>
</div> </div>
</template> </template>

View File

@ -1,16 +1,20 @@
<template> <template>
<div class="modal"> <div>
<div v-bind:class="{'is-active':show}" class="modal">
<div class="modal-background"></div> <div class="modal-background"></div>
<button class="modal-close is-large" aria-label="close" @click="$emit('close')"></button> <button class="modal-close is-large" aria-label="close" @click="$emit('close')"></button>
<div class="modal-content box"> <div class="modal-content box">
<slot></slot> <slot></slot>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
export default { export default {
props:{
show:false,
},
}; };
</script> </script>

View File

@ -1,11 +1,8 @@
<!-- components/Login.vue --> <!-- components/Login.vue -->
<template> <template>
<div class="modal"> <modal v-bind:show="show" @close="$emit('close')">
<div class="modal-background"></div> <div class="hero is-success">
<button class="modal-close is-large" aria-label="close" @click="$emit('close')"></button> <div class="hero-body has-text-centered">
<div class="modal-content box">
<div class="section is-success">
<div class="has-text-centered">
<h2 class="title">Login</h2> <h2 class="title">Login</h2>
<p class="subtitle error-msg">{{ errorMsg }}</p> <p class="subtitle error-msg">{{ errorMsg }}</p>
</div> </div>
@ -28,14 +25,16 @@
<a class="button is-success is-large" @click="authenticate">Login</a> <a class="button is-success is-large" @click="authenticate">Login</a>
</div> </div>
</section> </section>
</div> </modal>
</div>
</template> </template>
<script> <script>
import { EventBus } from "../utils"; import { EventBus } from '../utils';
import modal from './modal'
export default { export default {
props:{
show:false,
},
data() { data() {
return { return {
name: "", name: "",
@ -43,6 +42,9 @@ export default {
errorMsg: "" errorMsg: ""
}; };
}, },
components: {
modal
},
methods: { methods: {
authenticate() { authenticate() {
this.$store this.$store