Skip to content

Instantly share code, notes, and snippets.

@colinf
Last active February 23, 2017 14:32
Show Gist options
  • Save colinf/06d2ed9604bf38a605469b4d5f63cf61 to your computer and use it in GitHub Desktop.
Save colinf/06d2ed9604bf38a605469b4d5f63cf61 to your computer and use it in GitHub Desktop.
Example of using modal-vue component ( see http://j.mp/2m3mQGt )
<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