Last active
February 23, 2017 14:32
-
-
Save colinf/06d2ed9604bf38a605469b4d5f63cf61 to your computer and use it in GitHub Desktop.
Example of using modal-vue component ( see http://j.mp/2m3mQGt )
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 id="app"> | |
<div> | |
<button @click="showModal = true">Show it</button> | |
</div> | |
<modal :showModal="showModal" :closeAction="closeDialog"> | |
<h1 slot="header">Simple Dialog</h1> | |
<span slot="body"> | |
Hello <strong>simple!</strong> | |
</span> | |
</modal> | |
</div> | |
</template> | |
<script> | |
import Modal from 'modal-vue' | |
export default { | |
components: { Modal }, | |
data () { | |
return { | |
showModal: false, | |
} | |
}, | |
methods : { | |
closeDialog () { | |
this.showModal = false | |
} | |
} | |
} | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment