1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
| <template> <div id="myModal" class="modal" v-if="displayFlag"> <div class="modal-content"> <div class="modal-header"> <span class="close" v-on:click="$emit('close', flag)">×</span> <h2>系统提示信息</h2> </div> <div class="modal-body"> <p>{{ msg }}</p> </div> <div class="modal-footer"> <button v-on:click="$emit('close', flag)">关闭</button> </div> </div> </div> </template>
<script> export default { name: 'ViewTemplate', props: { msg: String, displayFlag: Boolean }, data: function () { return { title: 'ViewTemplate', flag: false, } }, } </script>
<style scoped>
.modal { position: fixed; z-index: 1; padding-top: 100px; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0,0,0); background-color: rgba(0,0,0,0.4); }
.modal-content { display: flex; flex-direction: column; justify-content: space-between; position: relative; background-color: #fefefe; margin: auto; padding: 0; border: 1px solid #888; width: 50vw; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); -webkit-animation-name: animatetop; -webkit-animation-duration: 0.4s; animation-name: animatetop; animation-duration: 0.4s; }
@-webkit-keyframes animatetop { from {top:-300px; opacity:0} to {top:0; opacity:1} }
@keyframes animatetop { from {top: -300px; opacity:0} to {top:0; opacity:1} }
.close { color: white; float: right; font-size: 28px; font-weight: bold; }
.close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; }
.modal-header { padding: 2px 16px; background-color: #5587A2; color: black; }
.modal-body { overflow: auto; padding: 2px 16px; flex-grow: 1; }
.modal-footer { padding: 2px 16px; background-color: #5587A2; text-align: center; color: black; } </style>
|