mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs(Tabbar): fix incorrect icon url (#4869)
This commit is contained in:
parent
0206ecd163
commit
43379d20b3
@ -75,7 +75,7 @@ Use `icon` slot to custom icon
|
||||
<img
|
||||
slot="icon"
|
||||
slot-scope="props"
|
||||
:src="props.active ? icon.active : icon.normal"
|
||||
:src="props.active ? icon.active : icon.inactive"
|
||||
>
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="search">Tab</van-tabbar-item>
|
||||
@ -89,8 +89,8 @@ export default {
|
||||
return {
|
||||
active: 0,
|
||||
icon: {
|
||||
normal: '//img.yzcdn.cn/icon-normal.png',
|
||||
active: '//img.yzcdn.cn/icon-active.png'
|
||||
active: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||
inactive: 'https://img.yzcdn.cn/vant/user-inactive.png'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ export default {
|
||||
<img
|
||||
slot="icon"
|
||||
slot-scope="props"
|
||||
:src="props.active ? icon.active : icon.normal"
|
||||
:src="props.active ? icon.active : icon.inactive"
|
||||
>
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="search">标签</van-tabbar-item>
|
||||
@ -95,8 +95,8 @@ export default {
|
||||
return {
|
||||
active: 0,
|
||||
icon: {
|
||||
normal: '//img.yzcdn.cn/icon-normal.png',
|
||||
active: '//img.yzcdn.cn/icon-active.png'
|
||||
active: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||
inactive: 'https://img.yzcdn.cn/vant/user-inactive.png'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,54 +11,19 @@
|
||||
|
||||
<demo-block :title="$t('matchByName')">
|
||||
<van-tabbar v-model="activeName">
|
||||
<van-tabbar-item
|
||||
name="home"
|
||||
icon="home-o"
|
||||
>
|
||||
{{ $t('tab') }}
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item
|
||||
name="search"
|
||||
icon="search"
|
||||
>
|
||||
{{ $t('tab') }}
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item
|
||||
name="friends"
|
||||
icon="friends-o"
|
||||
>
|
||||
{{ $t('tab') }}
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item
|
||||
name="setting"
|
||||
icon="setting-o"
|
||||
>
|
||||
{{ $t('tab') }}
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item name="home" icon="home-o">{{ $t('tab') }}</van-tabbar-item>
|
||||
<van-tabbar-item name="search" icon="search">{{ $t('tab') }}</van-tabbar-item>
|
||||
<van-tabbar-item name="friends" icon="friends-o">{{ $t('tab') }}</van-tabbar-item>
|
||||
<van-tabbar-item name="setting" icon="setting-o">{{ $t('tab') }}</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('badge')">
|
||||
<van-tabbar v-model="active2">
|
||||
<van-tabbar-item icon="home-o">{{ $t('tab') }}</van-tabbar-item>
|
||||
<van-tabbar-item
|
||||
icon="search"
|
||||
dot
|
||||
>
|
||||
{{ $t('tab') }}
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item
|
||||
icon="friends-o"
|
||||
info="5"
|
||||
>
|
||||
{{ $t('tab') }}
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item
|
||||
icon="setting-o"
|
||||
info="20"
|
||||
>
|
||||
{{ $t('tab') }}
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="search" dot>{{ $t('tab') }}</van-tabbar-item>
|
||||
<van-tabbar-item icon="friends-o" info="5">{{ $t('tab') }}</van-tabbar-item>
|
||||
<van-tabbar-item icon="setting-o" info="20">{{ $t('tab') }}</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
</demo-block>
|
||||
|
||||
@ -67,7 +32,7 @@
|
||||
<van-tabbar-item info="3">
|
||||
<span>{{ $t('custom') }}</span>
|
||||
<template #icon="{ active }">
|
||||
<img :src="active ? icon.active : icon.normal">
|
||||
<img :src="active ? icon.active : icon.inactive">
|
||||
</template>
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="search">{{ $t('tab') }}</van-tabbar-item>
|
||||
@ -76,11 +41,7 @@
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('customColor')">
|
||||
<van-tabbar
|
||||
v-model="active4"
|
||||
active-color="#07c160"
|
||||
inactive-color="#000"
|
||||
>
|
||||
<van-tabbar v-model="active4" active-color="#07c160" inactive-color="#000">
|
||||
<van-tabbar-item icon="home-o">{{ $t('tab') }}</van-tabbar-item>
|
||||
<van-tabbar-item icon="search">{{ $t('tab') }}</van-tabbar-item>
|
||||
<van-tabbar-item icon="friends-o">{{ $t('tab') }}</van-tabbar-item>
|
||||
@ -115,8 +76,8 @@ export default {
|
||||
active4: 0,
|
||||
activeName: 'home',
|
||||
icon: {
|
||||
normal: 'https://img.yzcdn.cn/public_files/2017/10/13/c547715be149dd3faa817e4a948b40c4.png',
|
||||
active: 'https://img.yzcdn.cn/public_files/2017/10/13/793c77793db8641c4c325b7f25bf130d.png'
|
||||
active: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||
inactive: 'https://img.yzcdn.cn/vant/user-inactive.png'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -41,36 +41,28 @@ exports[`renders demo correctly 1`] = `
|
||||
<!----></i>
|
||||
<!---->
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">
|
||||
标签
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">标签</div>
|
||||
</div>
|
||||
<div class="van-tabbar-item">
|
||||
<div class="van-tabbar-item__icon"><i class="van-icon van-icon-search">
|
||||
<!----></i>
|
||||
<!---->
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">
|
||||
标签
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">标签</div>
|
||||
</div>
|
||||
<div class="van-tabbar-item">
|
||||
<div class="van-tabbar-item__icon"><i class="van-icon van-icon-friends-o">
|
||||
<!----></i>
|
||||
<!---->
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">
|
||||
标签
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">标签</div>
|
||||
</div>
|
||||
<div class="van-tabbar-item">
|
||||
<div class="van-tabbar-item__icon"><i class="van-icon van-icon-setting-o">
|
||||
<!----></i>
|
||||
<!---->
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">
|
||||
标签
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">标签</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -88,34 +80,28 @@ exports[`renders demo correctly 1`] = `
|
||||
<!----></i>
|
||||
<div class="van-info van-info--dot"></div>
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">
|
||||
标签
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">标签</div>
|
||||
</div>
|
||||
<div class="van-tabbar-item">
|
||||
<div class="van-tabbar-item__icon"><i class="van-icon van-icon-friends-o">
|
||||
<!----></i>
|
||||
<div class="van-info">5</div>
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">
|
||||
标签
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">标签</div>
|
||||
</div>
|
||||
<div class="van-tabbar-item">
|
||||
<div class="van-tabbar-item__icon"><i class="van-icon van-icon-setting-o">
|
||||
<!----></i>
|
||||
<div class="van-info">20</div>
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">
|
||||
标签
|
||||
</div>
|
||||
<div class="van-tabbar-item__text">标签</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="van-hairline--top-bottom van-tabbar van-tabbar--fixed" style="z-index: 1;">
|
||||
<div class="van-tabbar-item van-tabbar-item--active">
|
||||
<div class="van-tabbar-item__icon"><img src="https://img.yzcdn.cn/public_files/2017/10/13/793c77793db8641c4c325b7f25bf130d.png">
|
||||
<div class="van-tabbar-item__icon"><img src="https://img.yzcdn.cn/vant/user-active.png">
|
||||
<div class="van-info">3</div>
|
||||
</div>
|
||||
<div class="van-tabbar-item__text"><span>自定义</span></div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user