/
githubmirror
/
element
Обзор
Документация
Войти
/
githubmirror
/
element
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/container/src/main.vue
33 строки
754 B
杨奕
add layout (#6600)
22 авг 2017, 07:46
22 авг 2017, 07:46
bf66612
Код
Авторство
О чём код?
<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>