├── modal.gif ├── package.json ├── .gitignore ├── README.md └── src └── modal.vue /modal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coffcer/vue-bootstrap-modal/HEAD/modal.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-bootstrap-modal", 3 | "description": "Bootstrap Style Modal for Vue", 4 | "version": "0.1.14", 5 | "author": "coffce", 6 | "main": "./src/modal.vue", 7 | "repository": { 8 | "type": "git", 9 | "url": "git+https://github.com/Coffcer/vue-bootstrap-modal" 10 | }, 11 | "browserify": { 12 | "transform": [ 13 | [ 14 | "babelify", 15 | { 16 | "presets": [ 17 | "es2015" 18 | ] 19 | } 20 | ], 21 | [ 22 | "vueify" 23 | ] 24 | ] 25 | }, 26 | "keywords": [ 27 | "vue", 28 | "modal", 29 | "vue-modal" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-bootstrap-modal 2 | 3 | Bootstrap style modal component for vue. 4 | 5 | 6 | 7 | # Usage 8 | 9 | import Bootstrap.css 10 | ``` 11 | 12 | ``` 13 | **NOTE:** By default, the modal style is pure bootstrap style, you can use any 3rd party bootstrap framework, like above GIF. 14 | 15 | 16 | simple options: 17 | ``` html 18 | 19 | 20 | Modal Text 21 | 22 | 23 | 24 | 25 |
Modal Body
26 | 27 |
Modal Header
28 |
Modal Title
29 |
Modal Footer
30 |
31 | 32 | ``` 33 | 34 | #Props 35 | ``` javascript 36 | props: { 37 | show: { 38 | type: Boolean, 39 | twoWay: true, 40 | default: false 41 | }, 42 | title: { 43 | type: String, 44 | default: 'Modal' 45 | }, 46 | // Bootstrap small style modal 47 | small: { 48 | type: Boolean, 49 | default: false 50 | }, 51 | // Bootstrap large style modal 52 | large: { 53 | type: Boolean, 54 | default: false 55 | }, 56 | // Bootstrap full style modal 57 | full: { 58 | type: Boolean, 59 | default: false 60 | }, 61 | // if it set false, click background will close modal 62 | force: { 63 | type: Boolean, 64 | default: false 65 | }, 66 | // vue transition name 67 | transition: { 68 | type: String, 69 | default: 'modal' 70 | }, 71 | // [OK button] text 72 | okText: { 73 | type: String, 74 | default: 'OK' 75 | }, 76 | // [Cancel button] text 77 | cancelText: { 78 | type: String, 79 | default: 'Cancel' 80 | }, 81 | // [OK button] className 82 | okClass: { 83 | type: String, 84 | default: 'btn blue' 85 | }, 86 | // [Cancel button] className 87 | cancelClass: { 88 | type: String, 89 | default: 'btn red btn-outline' 90 | }, 91 | // automatically close when click [OK button] 92 | closeWhenOK: { 93 | type: Boolean, 94 | default: false 95 | } 96 | } 97 | ``` 98 | 99 | # License 100 | MIT -------------------------------------------------------------------------------- /src/modal.vue: -------------------------------------------------------------------------------- 1 | 127 | 128 | 161 | 162 | 184 | --------------------------------------------------------------------------------