Created
November 26, 2016 17:06
-
-
Save argentinaluiz/a685fe12b046a6b4941bb460e2a5b847 to your computer and use it in GitHub Desktop.
Materialize Modal with Vue.js 1
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
| export default { | |
| template: ` | |
| <div :id="modal.id" class="modal"> | |
| <div class="modal-content"> | |
| <slot name="content"></slot> | |
| </div> | |
| <div class="modal-footer"> | |
| <slot name="footer"></slot> | |
| </div> | |
| </div> | |
| `, | |
| props: { | |
| modal: { | |
| type: Object, | |
| default(){ | |
| return { | |
| id: '' | |
| } | |
| } | |
| } | |
| }, | |
| ready(){ | |
| let id = this.modal.id; | |
| $(document).ready(() => { | |
| $(`#${id}`).modal(); | |
| }); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment