wui-components-v2 1.2.12 → 1.2.14

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.
@@ -39,6 +39,11 @@ const props = defineProps({
39
39
  type: Boolean,
40
40
  default: true,
41
41
  },
42
+ // 菜单网格列数,调用方可覆盖默认 4 列
43
+ column: {
44
+ type: Number,
45
+ default: 4,
46
+ },
42
47
  })
43
48
  const languageStore = useLanguageStore()
44
49
  const themeConfig = ref<any>({})
@@ -83,6 +88,9 @@ onMounted(() => {
83
88
  <slot name="top" :style="{ background: currentThemeColor.primary }" />
84
89
  <view v-if="props.menuTopType === '自定义'" class="p-2" />
85
90
  </template>
91
+ <template #topImg>
92
+ <slot name="topImg" />
93
+ </template>
86
94
  <view class="px-3 pb-4">
87
95
  <!-- 菜单搜索 -->
88
96
  <searchBar v-if="themeConfig?.showHomePage" />
@@ -107,7 +115,10 @@ onMounted(() => {
107
115
  </text>
108
116
  </view>
109
117
  <view class="section-tag">
110
- <text class="tag-text">{{ props.tile ? tileItems.length : filtermenu.length }} {{ props.tile ? languageStore.t('个功能') : languageStore.t('个分类') }}</text>
118
+ <text class="tag-text">
119
+ {{ props.tile ? tileItems.length : filtermenu.length }}
120
+ {{ props.tile ? languageStore.t('个功能') : languageStore.t('个分类') }}
121
+ </text>
111
122
  </view>
112
123
  </view>
113
124
  <view v-else class="py-3"></view>
@@ -122,7 +133,7 @@ onMounted(() => {
122
133
  >
123
134
  <template #content>
124
135
  <view class="menu-grid-container">
125
- <wd-grid :column="4" clickable class="menu-grid">
136
+ <wd-grid :column="props.column" clickable class="menu-grid">
126
137
  <wd-grid-item
127
138
  v-for="(subItem, subIndex) in item.items"
128
139
  :key="subIndex"
@@ -132,23 +143,36 @@ onMounted(() => {
132
143
  @click="gotoPage(subItem)"
133
144
  >
134
145
  <template #icon>
135
- <view
136
- class="menu-icon-wrapper flex items-center justify-center"
137
- :style="{ background: subItem.color }"
146
+ <slot
147
+ name="menu-item-icon"
148
+ :sub-item="subItem"
149
+ :index="subIndex"
150
+ :goto="gotoPage"
151
+ :t="languageStore.t"
138
152
  >
139
- <text class="menu-icon !text-xl iconfont" :class="[subItem.appIcon || 'i-carbon:grid']" />
140
- <view class="icon-shine" />
141
- </view>
153
+ <view
154
+ class="menu-icon-wrapper flex items-center justify-center"
155
+ :style="{ background: subItem.color }"
156
+ >
157
+ <text class="menu-icon !text-xl iconfont" :class="[subItem.appIcon || 'i-carbon:grid']" />
158
+ <view class="icon-shine" />
159
+ </view>
160
+ </slot>
142
161
  </template>
143
162
  <template #text>
144
- <view class="menu-text-wrapper">
145
- <view class="menu-title text-ellipsis dark:text-white text-gray-800">
146
- {{ languageStore.t(subItem.title) }}
163
+ <slot
164
+ name="menu-item-text"
165
+ :sub-item="subItem"
166
+ :index="subIndex"
167
+ :goto="gotoPage"
168
+ :t="languageStore.t"
169
+ >
170
+ <view class="menu-text-wrapper">
171
+ <view class="menu-title text-ellipsis dark:text-white text-gray-800">
172
+ {{ languageStore.t(subItem.title) }}
173
+ </view>
147
174
  </view>
148
- <!-- <view class="menu-badge" v-if="subIndex === 0">
149
- <text class="badge-dot" />
150
- </view> -->
151
- </view>
175
+ </slot>
152
176
  </template>
153
177
  </wd-grid-item>
154
178
  </wd-grid>
@@ -158,12 +182,7 @@ onMounted(() => {
158
182
  </template>
159
183
 
160
184
  <template v-else>
161
- <slot
162
- name="tile"
163
- :items="tileItems"
164
- :goto="gotoPage"
165
- :t="languageStore.t"
166
- />
185
+ <slot name="tile" :items="tileItems" :goto="gotoPage" :t="languageStore.t" />
167
186
  </template>
168
187
  </view>
169
188
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.2.12",
3
+ "version": "1.2.14",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",