mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment * [new feature] add i18n support * feat: Extract demos from markdown * feat: Base components demos * [new feature] complete demo extract & translate * [fix] text cases * fix: add deepAssign test cases * fix: changelog detail * [new feature] AddressEdit support i18n
82 lines
1.8 KiB
Vue
82 lines
1.8 KiB
Vue
<template>
|
|
<demo-section>
|
|
<demo-block :title="$t('basicUsage')">
|
|
<van-button @click="show1 = true">{{ $t('button1') }}</van-button>
|
|
<van-actionsheet v-model="show1" :actions="actions" />
|
|
</demo-block>
|
|
|
|
<demo-block :title="$t('title2')">
|
|
<van-button @click="show2 = true">{{ $t('button2') }}</van-button>
|
|
<van-actionsheet v-model="show2" :actions="actions" :cancelText="$t('cancel')" />
|
|
</demo-block>
|
|
|
|
<demo-block :title="$t('title3')">
|
|
<van-button @click="show3 = true">{{ $t('button3') }}</van-button>
|
|
<van-actionsheet v-model="show3" :title="$t('title')">
|
|
<p>{{ $t('content') }}</p>
|
|
</van-actionsheet>
|
|
</demo-block>
|
|
</demo-section>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
i18n: {
|
|
'zh-CN': {
|
|
button1: '弹出 Actionsheet',
|
|
button2: '弹出带取消按钮的 Actionsheet',
|
|
button3: '弹出带标题的 Actionsheet',
|
|
title2: '带取消按钮的 Actionsheet',
|
|
title3: '带标题的 Actionsheet'
|
|
},
|
|
'en-US': {
|
|
button1: 'Show Actionsheet',
|
|
button2: 'Show Actionsheet with cancel button',
|
|
button3: 'Show Actionsheet with title',
|
|
title2: 'Actionsheet with cancel button',
|
|
title3: 'Actionsheet with title'
|
|
}
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
show1: false,
|
|
show2: false,
|
|
show3: false
|
|
};
|
|
},
|
|
|
|
computed: {
|
|
actions() {
|
|
return [
|
|
{ name: this.$t('option'), callback: this.onClick },
|
|
{ name: this.$t('option') },
|
|
{ name: this.$t('option'), loading: true }
|
|
];
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
onClick(item) {
|
|
Toast(item.name);
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="postcss">
|
|
.demo-actionsheet {
|
|
.actionsheet-wx {
|
|
color: #06bf04;
|
|
}
|
|
|
|
.van-button {
|
|
margin-left: 15px;
|
|
}
|
|
|
|
p {
|
|
padding: 20px;
|
|
}
|
|
}
|
|
</style>
|