|
1 | 1 | <template> |
2 | 2 | <div> |
3 | | - <portal to="modal"> |
4 | | - <div |
5 | | - :key="key" |
6 | | - class="ds-modal-wrapper"> |
7 | | - <transition |
8 | | - name="ds-transition-fade" |
9 | | - appear> |
10 | | - <div |
11 | | - v-if="isOpen" |
12 | | - class="ds-modal-backdrop" |
13 | | - ref="backdrop" |
14 | | - @click="backdropHandler" |
15 | | - > |
16 | | - |
17 | | - </div> |
18 | | - </transition> |
19 | | - <transition |
20 | | - name="ds-transition-modal-appear" |
21 | | - appear> |
22 | | - <ds-card |
23 | | - v-if="isOpen" |
24 | | - class="ds-modal" |
25 | | - :class="[extended && 'ds-modal-extended']" |
26 | | - :header="title" |
27 | | - tableindex="-1" |
28 | | - role="dialog" |
29 | | - ref="modal" |
30 | | - style="display: block" |
31 | | - > |
32 | | - <ds-button |
33 | | - v-if="!force" |
34 | | - class="ds-modal-close" |
35 | | - ghost |
36 | | - size="small" |
37 | | - icon="close" |
38 | | - aria-hidden="true" |
39 | | - @click="cancel('close')" |
40 | | - /> |
41 | | - <!-- @slot Modal content --> |
42 | | - <slot ref="modalBody"/> |
43 | | - <template slot="footer"> |
44 | | - <!-- @slot Modal footer with action buttons --> |
45 | | - <slot |
46 | | - name="footer" |
47 | | - :confirm="confirm" |
48 | | - :cancel="cancel" |
49 | | - :cancelLabel="cancelLabel" |
50 | | - :confirmLabel="confirmLabel" |
51 | | - > |
52 | | - <ds-button |
53 | | - ghost |
54 | | - icon="close" |
55 | | - @click.prevent="cancel('cancel')">{{ cancelLabel }}</ds-button> |
56 | | - <ds-button |
57 | | - primary |
58 | | - icon="check" |
59 | | - @click.prevent="confirm('confirm')">{{ confirmLabel }}</ds-button> |
60 | | - </slot> |
61 | | - </template> |
62 | | - </ds-card> |
63 | | - </transition> |
64 | | - </div> |
65 | | - </portal> |
| 3 | + <div |
| 4 | + :key="key" |
| 5 | + class="ds-modal-wrapper"> |
| 6 | + <transition |
| 7 | + name="ds-transition-fade" |
| 8 | + appear> |
| 9 | + <div |
| 10 | + v-if="isOpen" |
| 11 | + class="ds-modal-backdrop" |
| 12 | + ref="backdrop" |
| 13 | + @click="backdropHandler" |
| 14 | + > |
| 15 | + |
| 16 | + </div> |
| 17 | + </transition> |
| 18 | + <transition |
| 19 | + name="ds-transition-modal-appear" |
| 20 | + appear> |
| 21 | + <ds-card |
| 22 | + v-if="isOpen" |
| 23 | + class="ds-modal" |
| 24 | + :class="[extended && 'ds-modal-extended']" |
| 25 | + :header="title" |
| 26 | + tableindex="-1" |
| 27 | + role="dialog" |
| 28 | + ref="modal" |
| 29 | + style="display: block" |
| 30 | + > |
| 31 | + <ds-button |
| 32 | + v-if="!force" |
| 33 | + class="ds-modal-close" |
| 34 | + ghost |
| 35 | + size="small" |
| 36 | + icon="close" |
| 37 | + aria-hidden="true" |
| 38 | + @click="cancel('close')" |
| 39 | + /> |
| 40 | + <!-- @slot Modal content --> |
| 41 | + <slot ref="modalBody"/> |
| 42 | + <template slot="footer"> |
| 43 | + <!-- @slot Modal footer with action buttons --> |
| 44 | + <slot |
| 45 | + name="footer" |
| 46 | + :confirm="confirm" |
| 47 | + :cancel="cancel" |
| 48 | + :cancelLabel="cancelLabel" |
| 49 | + :confirmLabel="confirmLabel" |
| 50 | + > |
| 51 | + <ds-button |
| 52 | + ghost |
| 53 | + icon="close" |
| 54 | + @click.prevent="cancel('cancel')">{{ cancelLabel }}</ds-button> |
| 55 | + <ds-button |
| 56 | + primary |
| 57 | + icon="check" |
| 58 | + @click.prevent="confirm('confirm')">{{ confirmLabel }}</ds-button> |
| 59 | + </slot> |
| 60 | + </template> |
| 61 | + </ds-card> |
| 62 | + </transition> |
| 63 | + </div> |
66 | 64 | </div> |
67 | 65 | </template> |
68 | 66 |
|
69 | 67 | <script> |
70 | 68 | import Vue from 'vue' |
71 | | -import portal from 'portal-vue' |
72 | | -Vue.use(portal) |
73 | 69 |
|
74 | 70 | /* eslint-disable no-empty */ |
75 | 71 |
|
|
0 commit comments