docs: simplify $t to t

This commit is contained in:
chenjiahan
2020-03-21 14:46:02 +08:00
parent 10f32d6619
commit d8fa4b9495
80 changed files with 918 additions and 950 deletions
+35 -43
View File
@@ -1,103 +1,95 @@
<template>
<demo-section>
<demo-block :title="$t('basicUsage')">
<demo-block :title="t('basicUsage')">
<van-tabs v-model="active">
<van-tab :title="$t('tab') + index" v-for="index in tabs" :key="index">
{{ $t('content') }} {{ index }}
<van-tab :title="t('tab') + index" v-for="index in tabs" :key="index">
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
<demo-block :title="$t('matchByName')">
<demo-block :title="t('matchByName')">
<van-tabs v-model="activeName">
<van-tab name="a" :title="$t('tab') + 1">
{{ $t('content') }} 1
</van-tab>
<van-tab name="b" :title="$t('tab') + 2">
{{ $t('content') }} 2
</van-tab>
<van-tab name="c" :title="$t('tab') + 3">
{{ $t('content') }} 3
</van-tab>
<van-tab name="a" :title="t('tab') + 1"> {{ t('content') }} 1 </van-tab>
<van-tab name="b" :title="t('tab') + 2"> {{ t('content') }} 2 </van-tab>
<van-tab name="c" :title="t('tab') + 3"> {{ t('content') }} 3 </van-tab>
</van-tabs>
</demo-block>
<demo-block :title="$t('title2')">
<demo-block :title="t('title2')">
<van-tabs>
<van-tab v-for="index in 8" :title="$t('tab') + index" :key="index">
{{ $t('content') }} {{ index }}
<van-tab v-for="index in 8" :title="t('tab') + index" :key="index">
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
<demo-block :title="$t('title3')">
<demo-block :title="t('title3')">
<van-tabs @disabled="onClickDisabled">
<van-tab
v-for="index in 3"
:title="$t('tab') + index"
:title="t('tab') + index"
:disabled="index === 2"
:key="index"
>
{{ $t('content') }} {{ index }}
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
<demo-block :title="$t('title4')">
<demo-block :title="t('title4')">
<van-tabs type="card">
<van-tab v-for="index in 3" :title="$t('tab') + index" :key="index">
{{ $t('content') }} {{ index }}
<van-tab v-for="index in 3" :title="t('tab') + index" :key="index">
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
<demo-block :title="$t('title5')">
<demo-block :title="t('title5')">
<van-tabs @click="onClick">
<van-tab v-for="index in 2" :title="$t('tab') + index" :key="index">
{{ $t('content') }} {{ index }}
<van-tab v-for="index in 2" :title="t('tab') + index" :key="index">
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
<demo-block :title="$t('title6')">
<demo-block :title="t('title6')">
<van-tabs :active="active" sticky>
<van-tab :title="$t('tab') + index" v-for="index in tabs" :key="index">
{{ $t('content') }} {{ index }}
<van-tab :title="t('tab') + index" v-for="index in tabs" :key="index">
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
<demo-block v-if="!isWeapp" :title="$t('title7')">
<demo-block v-if="!isWeapp" :title="t('title7')">
<van-tabs :active="active">
<van-tab v-for="index in 2" :key="index">
<template #title>
<van-icon name="more-o" />{{ $t('tab') }}
</template>
{{ $t('content') }} {{ index }}
<template #title> <van-icon name="more-o" />{{ t('tab') }} </template>
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
<demo-block :title="$t('title8')">
<demo-block :title="t('title8')">
<van-tabs animated>
<van-tab :title="$t('tab') + index" v-for="index in tabs" :key="index">
{{ $t('content') }} {{ index }}
<van-tab :title="t('tab') + index" v-for="index in tabs" :key="index">
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
<demo-block :title="$t('title9')">
<demo-block :title="t('title9')">
<van-tabs :active="active" swipeable>
<van-tab :title="$t('tab') + index" v-for="index in tabs" :key="index">
{{ $t('content') }} {{ index }}
<van-tab :title="t('tab') + index" v-for="index in tabs" :key="index">
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
<demo-block v-if="!isWeapp" :title="$t('title10')">
<demo-block v-if="!isWeapp" :title="t('title10')">
<van-tabs scrollspy sticky>
<van-tab :title="$t('tab') + index" v-for="index in 8" :key="index">
{{ $t('content') }} {{ index }}
<van-tab :title="t('tab') + index" v-for="index in 8" :key="index">
{{ t('content') }} {{ index }}
</van-tab>
</van-tabs>
</demo-block>
@@ -148,7 +140,7 @@ export default {
methods: {
onClickDisabled(index, title) {
this.$toast(title + this.$t('disabled'));
this.$toast(title + this.t('disabled'));
},
onClick(index, title) {