w-ui-v1 1.1.25 → 1.1.27

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/w-menu/w-menu.vue +14 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-ui-v1",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
package/w-menu/w-menu.vue CHANGED
@@ -20,17 +20,16 @@
20
20
  name: 'WMenu',
21
21
  })
22
22
  const props = defineProps({
23
- icon: {
24
- type: Object,
25
- default: {
26
-
27
- }
23
+ icons: {
24
+ type: Array,
25
+ default: []
28
26
  }
29
27
  })
30
28
  const menuList = ref([])
31
29
  const title = ref('')
32
30
  const filtermenu = computed(() => {
33
- return filterHiddenTree(menuList.value, 'items', true)
31
+ let arr=filterHiddenTree(menuList.value, 'items', true)
32
+ return arr
34
33
  })
35
34
  const sheetShow = ref(false)
36
35
  const actions = ref([])
@@ -134,7 +133,13 @@
134
133
  if (Array.isArray(node[childKey])) {
135
134
  node[childKey] = filterHiddenTree(node[childKey], childKey, deepClone)
136
135
  }
137
- return node
136
+ let icon= props.icons.find((item:any)=>{
137
+ return item.id===node.id
138
+ })
139
+ return {
140
+ ...node,
141
+ iconPath:(icon as any)?.path
142
+ }
138
143
  })
139
144
  }
140
145
 
@@ -174,9 +179,9 @@
174
179
  @itemclick="gotoPage(subItem)" use-text-slot>
175
180
  <template #default>
176
181
  <view class="grid-item">
177
- <view v-if="props.icon.id" class="grid-item-icon"
182
+ <view v-if="subItem.iconPath" class="grid-item-icon"
178
183
  style="display: flex;justify-content: center;align-items: center;">
179
- <image style="height: 30px;width: 30px;" src="/static/home.png" mode="">
184
+ <image style="height: 30px;width: 30px;" :src="subItem.iconPath" mode="">
180
185
  </image>
181
186
  </view>
182
187
  <text v-else class="grid-item-icon">