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
| <template>
| <section class="el-container" :class="{ 'is-vertical': isVertical }">
| <slot></slot>
| </section>
| </template>
|
| <script>
| export default {
| name: 'ElContainer',
|
| componentName: 'ElContainer',
|
| props: {
| direction: String
| },
|
| computed: {
| isVertical() {
| if (this.direction === 'vertical') {
| return true;
| } else if (this.direction === 'horizontal') {
| return false;
| }
| return this.$slots && this.$slots.default
| ? this.$slots.default.some(vnode => {
| const tag = vnode.componentOptions && vnode.componentOptions.tag;
| return tag === 'el-header' || tag === 'el-footer';
| })
| : false;
| }
| }
| };
| </script>
|
|