mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
simplify test config (#639)
This commit is contained in:
47
test/components/tabs.vue
Normal file
47
test/components/tabs.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<van-tabs :active="active" :duration="duration" @click="handleTabClick" @disabled="handleTabDisabledClick" :sticky="sticky">
|
||||
<van-tab :title="firstTabTitle" :disabled="firstTabDisabled">内容一</van-tab>
|
||||
<van-tab title="选项二">内容二</van-tab>
|
||||
<van-tab title="选项三" disabled>内容三</van-tab>
|
||||
<van-tab title="选项四">内容四</van-tab>
|
||||
</van-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Tab from 'packages/tab';
|
||||
import Tabs from 'packages/tabs';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'van-tab': Tab,
|
||||
'van-tabs': Tabs
|
||||
},
|
||||
|
||||
props: {
|
||||
firstTabTitle: {
|
||||
type: String,
|
||||
default: '选项一'
|
||||
},
|
||||
firstTabDisabled: {
|
||||
type: Boolean
|
||||
},
|
||||
sticky: Boolean
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
active: 0,
|
||||
duration: 0.5
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleTabClick(index) {
|
||||
this.$emit('click');
|
||||
},
|
||||
handleTabDisabledClick(index) {
|
||||
this.$emit('disabled');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Reference in New Issue
Block a user