[improvement] Tab: extract title component (#3634)

This commit is contained in:
neverland
2019-06-25 18:02:43 +08:00
committed by GitHub
parent 51105f4194
commit e4d967a3f0
8 changed files with 216 additions and 195 deletions

View File

@@ -19,17 +19,13 @@ function createWrapper(options = {}) {
@change="onChange"
>
${options.extraTemplate || ''}
<van-tab :title="title1">Text</van-tab>
<van-tab>
<span slot="title">title2</span>
Text
</van-tab>
<van-tab title="title1">Text</van-tab>
<van-tab title="title2">Text</van-tab>
<van-tab title="title3" disabled>Text</van-tab>
</van-tabs>
`,
data() {
return {
title1: 'title1',
color: '#f44',
type: 'line',
swipeable: true,
@@ -96,8 +92,7 @@ test('change tabs data', async () => {
swipeable: false,
sticky: false,
type: 'card',
color: 'blue',
title1: 'new title1'
color: 'blue'
});
await later();