docs(tabbar): 更新注释说明并添加接口调用示例
更新store.ts中关于customTabbarList接口调用的注释说明 在index.vue中添加接口调用示例代码
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
// 'i-carbon-code',
|
||||
import { http } from '@/http/http'
|
||||
import { customTabbarEnable, nativeTabbarNeedHide, tabbarCacheEnable } from './config'
|
||||
import { tabbarStore } from './store'
|
||||
|
||||
@@ -10,6 +11,12 @@ defineOptions({
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #region 接口获取tabbar demo
|
||||
http.get('/foo').then((res) => {
|
||||
console.log('接口获取tabbar demo', res)
|
||||
})
|
||||
// #endregion
|
||||
|
||||
// TODO 1/2: 中间的鼓包tabbarItem的开关
|
||||
const BULGE_ENABLE = false
|
||||
function handleClickBulge() {
|
||||
|
||||
@@ -9,8 +9,9 @@ interface CustomTabBarItem {
|
||||
badge?: number | 'dot' // badge 显示一个数字或 小红点(样式可以直接在 tabbar/index.vue 里面修改)
|
||||
isBulge?: boolean // 是否是中间的鼓包tabbarItem
|
||||
}
|
||||
|
||||
// pagePath 是 nativeTabbarList 和 customTabbarList 的关联点,如果没有对应上,会有问题!!
|
||||
// 如果希望通过接口调用 customTabbarList,可以在本文件里面调用接口
|
||||
// 如果希望通过接口调用 customTabbarList,可以在 tabbar/index.vue 文件里面调用接口
|
||||
export const customTabbarList: CustomTabBarItem[] = [
|
||||
{
|
||||
// text 和 pagePath 可以自己直接写,也可以通过索引从 nativeTabbarList 中获取
|
||||
|
||||
Reference in New Issue
Block a user