wui-components-v2 1.1.10 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  <!-- 自定义背景风格登录页面 -->
2
2
  <script setup lang="ts">
3
3
  import { defineOptions, defineProps } from 'vue'
4
- import { onLoad } from '@dcloudio/uni-app'
5
4
  import LoginForm from '../login-form/login-form.vue'
6
5
  import { useManualTheme } from '../../composables/useManualTheme'
7
6
 
@@ -50,14 +50,18 @@ export default {
50
50
  <wd-config-provider :theme-vars="themeVars" :custom-class="`page-wraper ${theme}`" :theme="theme">
51
51
  <slot />
52
52
  <wd-tabbar
53
- :model-value="activeTabbar.name" bordered safe-area-inset-bottom placeholder fixed
54
- custom-class="z-14!"
53
+ :model-value="activeTabbar.name" bordered safe-area-inset-bottom placeholder fixed custom-class="z-14!"
55
54
  @change="handleTabbarChange"
56
55
  >
57
56
  <wd-tabbar-item
58
57
  v-for="(item, index) in tabbarList" :key="index" :name="item.name"
59
58
  :value="getTabbarItemValue(item.name)" :title="item.title" :icon="item.icon"
60
- />
59
+ >
60
+ <!-- 使用 icon 插槽自定义图标 -->
61
+ <template v-if="item.activeIcon" #icon="{ active }">
62
+ <image :src="active ? item.activeIcon : item.inactiveIcon" class="custom-icon" />
63
+ </template>
64
+ </wd-tabbar-item>
61
65
  </wd-tabbar>
62
66
  <!-- #ifdef MP-WEIXIN -->
63
67
  <privacy-popup />
@@ -81,4 +85,8 @@ export default {
81
85
  .wot-theme-dark.page-wraper {
82
86
  background: #222;
83
87
  }
88
+ .custom-icon {
89
+ width: 22px;
90
+ height: 22px;
91
+ }
84
92
  </style>
@@ -6,6 +6,8 @@ export interface TabbarItem {
6
6
  active: boolean
7
7
  title: string
8
8
  icon: string
9
+ activeIcon?: string // 激活状态自定义图标路径
10
+ inactiveIcon?: string // 未激活状态自定义图标路径
9
11
  }
10
12
  const tabbarItems: TabbarItem[] = uni.getStorageSync('TABBARITEMS')
11
13
  export function useTabbar() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",