[Doc] Swipe: update custom indicator document (#1978)

This commit is contained in:
neverland 2018-10-25 11:02:14 +08:00 committed by GitHub
parent a4b71aa402
commit 5564fbf624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 16 deletions

View File

@ -51,11 +51,9 @@
<van-swipe-item>3</van-swipe-item> <van-swipe-item>3</van-swipe-item>
<van-swipe-item>4</van-swipe-item> <van-swipe-item>4</van-swipe-item>
<template slot="indicator"> <div class="custom-indicator" slot="indicator">
<div class="custom-indicator"> {{ current + 1 }}/4
{{ this.current + 1 }}/4
</div> </div>
</template>
</van-swipe> </van-swipe>
</demo-block> </demo-block>
</demo-section> </demo-section>

View File

@ -97,11 +97,9 @@ export default {
<van-swipe-item>3</van-swipe-item> <van-swipe-item>3</van-swipe-item>
<van-swipe-item>4</van-swipe-item> <van-swipe-item>4</van-swipe-item>
<template slot="indicator"> <div class="custom-indicator" slot="indicator">
<div class="custom-indicator"> {{ current + 1 }}/4
{{ this.current + 1 }}/4
</div> </div>
</template>
</van-swipe> </van-swipe>
``` ```
@ -113,6 +111,7 @@ export default {
current: 0 current: 0
} }
}, },
onChange(index) { onChange(index) {
this.current = index; this.current = index;
} }

View File

@ -22,7 +22,6 @@
/> />
</div> </div>
</slot> </slot>
</div> </div>
</template> </template>

View File

@ -97,11 +97,9 @@ export default {
<van-swipe-item>3</van-swipe-item> <van-swipe-item>3</van-swipe-item>
<van-swipe-item>4</van-swipe-item> <van-swipe-item>4</van-swipe-item>
<template slot="indicator"> <div class="custom-indicator" slot="indicator">
<div class="custom-indicator"> {{ current + 1 }}/4
{{ this.current + 1 }}/4
</div> </div>
</template>
</van-swipe> </van-swipe>
``` ```
@ -113,6 +111,7 @@ export default {
current: 0 current: 0
} }
}, },
onChange(index) { onChange(index) {
this.current = index; this.current = index;
} }