[new feature] Tabs: add animated props to change tabs with animation (#2126)

This commit is contained in:
张敏
2018-11-23 19:51:47 +08:00
committed by neverland
parent 8042e37829
commit d84b13a6cc
15 changed files with 2097 additions and 268 deletions

View File

@@ -5,11 +5,24 @@
<span>Vant</span>
</h1>
<div class="mobile-switch-lang">
<span :class="{ active: $vantLang === 'en-US' }" @click="switchLang('en-US')">EN</span>
<span :class="{ active: $vantLang === 'zh-CN' }" @click="switchLang('zh-CN')">中文</span>
<span
:class="{ active: $vantLang === 'en-US' }"
@click="switchLang('en-US')"
>
EN
</span>
<span
:class="{ active: $vantLang === 'zh-CN' }"
@click="switchLang('zh-CN')"
>
中文
</span>
</div>
<h2 class="zanui-desc">{{ description }}</h2>
<template v-for="item in navList" v-if="item.showInMobile">
<template
v-for="item in navList"
v-if="item.showInMobile"
>
<mobile-nav
v-for="(group, index) in item.groups"
:group="group"
@@ -26,16 +39,16 @@ import MobileNav from './MobileNav';
import { setLang } from '../utils/lang';
export default {
components: {
MobileNav
},
data() {
return {
docConfig
};
},
components: {
MobileNav
},
computed: {
navList() {
return this.docConfig[this.$vantLang].nav || [];

View File

@@ -8,8 +8,16 @@
v-for="(demo, index) in demos"
>
<h4>{{ demo.title }}</h4>
<a :href="demo.source" target="_blank">{{ $t('source') }}</a>
<img :src="demo.preview" @click="onChangeDemo(demo, index)" >
<a
:href="demo.source"
target="_blank"
>
{{ $t('source') }}
</a>
<img
:src="demo.preview"
@click="onChangeDemo(demo, index)"
>
</div>
</div>
</section>

View File

@@ -1,6 +1,13 @@
<template>
<van-collapse v-model="active" class="mobile-nav">
<van-collapse-item :title="group.groupName" :name="group.groupName" class="mobile-nav__item">
<van-collapse
v-model="active"
class="mobile-nav"
>
<van-collapse-item
class="mobile-nav__item"
:title="group.groupName"
:name="group.groupName"
>
<van-cell
v-if="!navItem.disabled"
v-for="(navItem, index) in group.list"