提交 d3c73e5e 编写于 作者: G guoxiaoxiao8

Merge branch 'next' of https://github.com/jdf2e/nutui into next

<template> <template>
<div :class="[direction === 'vertical' ? 'vertical-tab' : 'nutui-tab']"> <view :class="[direction === 'vertical' ? 'vertical-tab' : 'nutui-tab']">
<div class="tab-title" ref="navlist"> <view class="tab-title" ref="navlist">
<div <view
:class="['tab-title-box', { 'nut-tab-active': activeIndex == index }]" :class="['tab-title-box', { 'nut-tab-active': activeIndex == index }]"
v-for="(item, index) in titles" v-for="(item, index) in titles"
:key="index" :key="index"
...@@ -9,15 +9,15 @@ ...@@ -9,15 +9,15 @@
> >
{{ item.title }} {{ item.title }}
<TabTitle v-bind:slots="item.content" v-if="item.content"></TabTitle> <TabTitle v-bind:slots="item.content" v-if="item.content"></TabTitle>
</div> </view>
<div class="underline"></div> <view class="underline"></view>
</div> </view>
<div :class="['nutui-tab-swiper', swiperClassName]"> <view :class="['nutui-tab-swiper', swiperClassName]">
<div :class="['swiper-wrapper', { 'swiper-no-swiping': noSwiping }]"> <view :class="['swiper-wrapper', { 'swiper-no-swiping': noSwiping }]">
<slot></slot> <slot></slot>
</div> </view>
</div> </view>
</div> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import { PropType, reactive, ref, onMounted, watch, VNode } from 'vue'; import { PropType, reactive, ref, onMounted, watch, VNode } from 'vue';
...@@ -26,7 +26,7 @@ const { create } = createComponent('tab'); ...@@ -26,7 +26,7 @@ const { create } = createComponent('tab');
import TabTitle from './tabTitle'; import TabTitle from './tabTitle';
import Swiper from 'swiper'; import Swiper from 'swiper';
import 'swiper/dist/css/swiper.min.css'; import 'swiper/dist/css/swiper.min.css';
import { extend } from '@vue/shared'; // import { extend } from '@vue/shared';
type TabDirection = 'horizontal' | 'vertical'; type TabDirection = 'horizontal' | 'vertical';
interface DataTitle { interface DataTitle {
...@@ -34,6 +34,10 @@ interface DataTitle { ...@@ -34,6 +34,10 @@ interface DataTitle {
content?: VNode[]; content?: VNode[];
} }
type currChild = {
header: Function;
} & VNode[];
export default create({ export default create({
props: { props: {
defaultIndex: { defaultIndex: {
...@@ -139,10 +143,8 @@ export default create({ ...@@ -139,10 +143,8 @@ export default create({
? item.props['tab-title'] ? item.props['tab-title']
: '', : '',
content: content:
//@ts-ignore:已经做了header是否存在的判断 item.children && (item.children as currChild).header
item && item?.children?.header ? (item.children as currChild).header()
? //@ts-ignore:已经做了header是否存在的判断
(item.children as VNode[]).header()
: null : null
}); });
}); });
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
.upload { .upload {
position: relative; position: relative;
background: $uploader-babackground; background: $uploader-background;
width: $uploader-width; width: $uploader-width;
height: $uploader-height; height: $uploader-height;
display: flex; display: flex;
......
...@@ -101,7 +101,7 @@ $icon-line-height: 20px; ...@@ -101,7 +101,7 @@ $icon-line-height: 20px;
$uploader-width: 100px; $uploader-width: 100px;
$uploader-height: 100px; $uploader-height: 100px;
$uploader-babackground: #f7f8fa; $uploader-background: #f7f8fa;
// inputnumber // inputnumber
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册