wui-components-v2 1.2.12 → 1.2.13

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>({})
@@ -122,7 +127,7 @@ onMounted(() => {
122
127
  >
123
128
  <template #content>
124
129
  <view class="menu-grid-container">
125
- <wd-grid :column="4" clickable class="menu-grid">
130
+ <wd-grid :column="props.column" clickable class="menu-grid">
126
131
  <wd-grid-item
127
132
  v-for="(subItem, subIndex) in item.items"
128
133
  :key="subIndex"
@@ -132,23 +137,36 @@ onMounted(() => {
132
137
  @click="gotoPage(subItem)"
133
138
  >
134
139
  <template #icon>
135
- <view
136
- class="menu-icon-wrapper flex items-center justify-center"
137
- :style="{ background: subItem.color }"
140
+ <slot
141
+ name="menu-item-icon"
142
+ :sub-item="subItem"
143
+ :index="subIndex"
144
+ :goto="gotoPage"
145
+ :t="languageStore.t"
138
146
  >
139
- <text class="menu-icon !text-xl iconfont" :class="[subItem.appIcon || 'i-carbon:grid']" />
140
- <view class="icon-shine" />
141
- </view>
147
+ <view
148
+ class="menu-icon-wrapper flex items-center justify-center"
149
+ :style="{ background: subItem.color }"
150
+ >
151
+ <text class="menu-icon !text-xl iconfont" :class="[subItem.appIcon || 'i-carbon:grid']" />
152
+ <view class="icon-shine" />
153
+ </view>
154
+ </slot>
142
155
  </template>
143
156
  <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) }}
157
+ <slot
158
+ name="menu-item-text"
159
+ :sub-item="subItem"
160
+ :index="subIndex"
161
+ :goto="gotoPage"
162
+ :t="languageStore.t"
163
+ >
164
+ <view class="menu-text-wrapper">
165
+ <view class="menu-title text-ellipsis dark:text-white text-gray-800">
166
+ {{ languageStore.t(subItem.title) }}
167
+ </view>
147
168
  </view>
148
- <!-- <view class="menu-badge" v-if="subIndex === 0">
149
- <text class="badge-dot" />
150
- </view> -->
151
- </view>
169
+ </slot>
152
170
  </template>
153
171
  </wd-grid-item>
154
172
  </wd-grid>
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.13",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",