refactor(TabsContent): refactor with composition api

This commit is contained in:
chenjiahan
2020-09-21 17:12:19 +08:00
parent 92aac941fc
commit 8ca7219acc
3 changed files with 85 additions and 86 deletions
+4 -4
View File
@@ -22,7 +22,7 @@ import { BindEventMixin } from '../mixins/bind-event';
// Components
import Title from './Title';
import Sticky from '../sticky';
import Content from './Content';
import TabsContent from './TabsContent';
const [createComponent, bem] = createNamespace('tabs');
@@ -92,7 +92,7 @@ export default createComponent({
return {
position: '',
currentIndex: null,
currentIndex: -1,
lineStyle: {
backgroundColor: this.color,
},
@@ -421,7 +421,7 @@ export default createComponent({
) : (
Wrap
)}
<Content
<TabsContent
count={this.children.length}
animated={animated}
duration={this.duration}
@@ -430,7 +430,7 @@ export default createComponent({
onChange={this.setCurrentIndex}
>
{this.$slots.default?.()}
</Content>
</TabsContent>
</div>
);
},