|
1 | 1 | <template>
|
2 |
| - <div class="msgbox" v-show="visible" transition="pop-bounce"> |
| 2 | + <div class="msgbox" v-if="rendered" v-show="visible" transition="pop-bounce"> |
3 | 3 | <div class="msgbox-header" v-if="title !== ''">
|
4 | 4 | <div class="msgbox-title">{{ title }}</div>
|
5 | 5 | <!--<div class="msgbox-close d-icon icon-close" @click="handleAction('close')"></div>-->
|
6 | 6 | </div>
|
7 | 7 | <div class="msgbox-content" v-if="message !== ''">
|
8 | 8 | <div class="msgbox-status d-icon {{ type ? 'icon-' + type : '' }}"></div>
|
9 |
| - <div class="msgbox-message">{{ message }}</div> |
| 9 | + <div class="msgbox-message"><p>{{ message }}</p></div> |
10 | 10 | <div class="msgbox-input" v-show="showInput">
|
11 | 11 | <input type="text" v-model="inputValue" :placeholder="inputPlaceholder" />
|
12 | 12 | <div class="msgbox-errormsg" :style="{ visibility: !!editorErrorMessage ? 'visible' : 'hidden' }">{{editorErrorMessage}}</div>
|
|
27 | 27 | border-radius: 3px;
|
28 | 28 | font-size: 16px;
|
29 | 29 | -webkit-user-select: none;
|
| 30 | + left: 50%; |
| 31 | + top: 50%; |
| 32 | + -webkit-transform: translate(-50%, -50%); |
| 33 | + transform: translate(-50%, -50%); |
30 | 34 | }
|
31 | 35 |
|
32 | 36 | .msgbox-header{
|
|
148 | 152 | .msgbox-btns-reverse .msgbox-cancel {
|
149 | 153 | border-right: 0;
|
150 | 154 | }
|
| 155 | +
|
| 156 | + .pop-bounce-enter { |
| 157 | + -webkit-animation: pop-bounce-in .3s cubic-bezier(0.3, 0, 0, 1.5); |
| 158 | + animation: pop-bounce-in .3s cubic-bezier(0.3, 0, 0, 1.5); |
| 159 | + } |
| 160 | +
|
| 161 | + .pop-bounce-leave { |
| 162 | + -webkit-animation: pop-bounce-out .2s cubic-bezier(0.895, 0.03, 0.685, 0.22); |
| 163 | + animation: pop-bounce-out .2s cubic-bezier(0.895, 0.03, 0.685, 0.22); |
| 164 | + } |
| 165 | +
|
| 166 | + @-webkit-keyframes pop-bounce-in { |
| 167 | + 0% { |
| 168 | + -webkit-transform: translate(-50%, -50%) scale(0.8); |
| 169 | + transform: translate(-50%, -50%) scale(0.8); |
| 170 | + } |
| 171 | + 100% { |
| 172 | + -webkit-transform: translate(-50%, -50%) scale(1); |
| 173 | + transform: translate(-50%, -50%) scale(1); |
| 174 | + } |
| 175 | + } |
| 176 | +
|
| 177 | + @keyframes pop-bounce-in { |
| 178 | + 0% { |
| 179 | + -webkit-transform: translate(-50%, -50%) scale(0.8); |
| 180 | + transform: translate(-50%, -50%) scale(0.8); |
| 181 | + } |
| 182 | + 100% { |
| 183 | + -webkit-transform: translate(-50%, -50%) scale(1); |
| 184 | + transform: translate(-50%, -50%) scale(1); |
| 185 | + } |
| 186 | + } |
| 187 | +
|
| 188 | + @-webkit-keyframes pop-bounce-out { |
| 189 | + 0% { |
| 190 | + -webkit-transform: translate(-50%, -50%) scale(1); |
| 191 | + transform: translate(-50%, -50%) scale(1); |
| 192 | + } |
| 193 | + 100% { |
| 194 | + -webkit-transform: translate(-50%, -50%) scale(0.7); |
| 195 | + transform: translate(-50%, -50%) scale(0.7); |
| 196 | + } |
| 197 | + } |
| 198 | +
|
| 199 | + @keyframes pop-bounce-out { |
| 200 | + 0% { |
| 201 | + -webkit-transform: translate(-50%, -50%) scale(1); |
| 202 | + transform: translate(-50%, -50%) scale(1); |
| 203 | + } |
| 204 | + 100% { |
| 205 | + -webkit-transform: translate(-50%, -50%) scale(0.7); |
| 206 | + transform: translate(-50%, -50%) scale(0.7); |
| 207 | + } |
| 208 | + } |
151 | 209 | </style>
|
152 | 210 | <style src="vue-popup/lib/popup.css"></style>
|
153 | 211 |
|
|
160 | 218 | export default {
|
161 | 219 | mixins: [ Popup ],
|
162 | 220 |
|
163 |
| - computed: { |
164 |
| - popupOptions() { |
165 |
| - return { |
166 |
| - target: 'center', |
167 |
| - modal: true, |
168 |
| - updatePositionOnResize: true, |
169 |
| - openAnimation: 'pop', |
170 |
| - closeDelay: 1, |
171 |
| - closeOnPressEscape: true |
172 |
| - // ,closeOnClickModal: true |
173 |
| - }; |
| 221 | + props: { |
| 222 | + modal: { |
| 223 | + default: true |
174 | 224 | },
|
| 225 | + closeOnPressEscape: { |
| 226 | + default: true |
| 227 | + } |
| 228 | + }, |
| 229 | +
|
| 230 | + computed: { |
175 | 231 | confirmButtonClasses() {
|
176 | 232 | var classes = 'msgbox-btn msgbox-confirm ' + this.confirmButtonClass;
|
177 | 233 | if (this.confirmButtonHighlight) {
|
|
0 commit comments