update package/component/src/component/layout/index.vue.

修复如果只引入了Footer组件,layui-layout-vertical样式不会生效,而导致布局错位的问题
<lay-layout class="example">
    <lay-layout>
      <lay-side>side</lay-side>
      <lay-body>content</lay-body>
    </lay-layout>
    <lay-footer>footer</lay-footer>
  </lay-layout>

Signed-off-by: 蒲公英 <qifeiweb@vip.qq.com>
This commit is contained in:
蒲公英 2022-09-22 16:10:15 +00:00 committed by Gitee
parent ccf208e884
commit 4a263d1ee8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -7,6 +7,7 @@ export default {
<script setup lang="ts">
import { Component, computed, useSlots } from "vue";
import Header from "../header/index.vue";
import Footer from "../footer/index.vue";
import "./index.less";
export interface LayLayoutProps {
@ -25,7 +26,7 @@ const isVertical = computed(() => {
return vNodes.some((vNode) => {
const componentName = (vNode.type as Component).name;
if (!componentName) return false;
return [Header.name].includes(componentName);
return [Header.name].includes(componentName) || [Footer.name].includes(componentName);
});
});