wui-components-v2 1.1.80 → 1.1.81
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.
|
@@ -26,7 +26,7 @@ function messageAction() {
|
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<template>
|
|
29
|
-
<view class="bg-white pa-3 backdrop-filter dark:bg-black">
|
|
29
|
+
<view class="bg-white pa-3 backdrop-filter custom-nar-bar dark:bg-black">
|
|
30
30
|
<view class="mx-auto max-w-7xl p-x-1">
|
|
31
31
|
<view class="flex items-center justify-center">
|
|
32
32
|
<view
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { PropType } from 'vue'
|
|
3
|
-
import { defineOptions, defineProps, ref } from 'vue'
|
|
3
|
+
import { computed, defineOptions, defineProps, ref } from 'vue'
|
|
4
4
|
import DemoCard from '../demo-card/demo-card.vue'
|
|
5
5
|
import { useMenus } from '../../composables/useMenus'
|
|
6
6
|
import type { Icon } from '../../composables/useMenus'
|
|
@@ -31,6 +31,10 @@ const props = defineProps({
|
|
|
31
31
|
type: String,
|
|
32
32
|
default: '',
|
|
33
33
|
},
|
|
34
|
+
tile: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
34
38
|
})
|
|
35
39
|
const languageStore = useLanguageStore()
|
|
36
40
|
const themeConfig = ref<any>({})
|
|
@@ -47,6 +51,12 @@ const {
|
|
|
47
51
|
sheetGotoPage,
|
|
48
52
|
navTitle,
|
|
49
53
|
} = useMenus(props, pagingRef)
|
|
54
|
+
|
|
55
|
+
// 当 tile 为 true 时,将 filtermenu 中所有分类的 items 平铺到一个数组中
|
|
56
|
+
const tileItems = computed(() => {
|
|
57
|
+
if (!props.tile) return []
|
|
58
|
+
return (filtermenu.value as any[]).flatMap((item: any) => item.items || [])
|
|
59
|
+
})
|
|
50
60
|
onMounted(() => {
|
|
51
61
|
getThemeConfig().then(res => {
|
|
52
62
|
if (res.status == 'success') {
|
|
@@ -93,53 +103,64 @@ onMounted(() => {
|
|
|
93
103
|
</text>
|
|
94
104
|
</view>
|
|
95
105
|
<view class="section-tag">
|
|
96
|
-
<text class="tag-text">{{ filtermenu.length }} {{ languageStore.t('个分类') }}</text>
|
|
106
|
+
<text class="tag-text">{{ props.tile ? tileItems.length : filtermenu.length }} {{ props.tile ? languageStore.t('个功能') : languageStore.t('个分类') }}</text>
|
|
97
107
|
</view>
|
|
98
108
|
</view>
|
|
99
109
|
<view v-else class="py-3"></view>
|
|
100
110
|
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<
|
|
110
|
-
<
|
|
111
|
-
<wd-grid-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<
|
|
130
|
-
<view class="menu-
|
|
131
|
-
|
|
111
|
+
<template v-if="!props.tile">
|
|
112
|
+
<DemoCard
|
|
113
|
+
v-for="(item, index) in filtermenu"
|
|
114
|
+
:key="index"
|
|
115
|
+
:title="languageStore.t(item.title)"
|
|
116
|
+
class="menu-card"
|
|
117
|
+
:style="{ animationDelay: `${(index as number) * 0.1}s` }"
|
|
118
|
+
>
|
|
119
|
+
<template #content>
|
|
120
|
+
<view class="menu-grid-container">
|
|
121
|
+
<wd-grid :column="4" clickable class="menu-grid">
|
|
122
|
+
<wd-grid-item
|
|
123
|
+
v-for="(subItem, subIndex) in item.items"
|
|
124
|
+
:key="subIndex"
|
|
125
|
+
use-text-slot
|
|
126
|
+
use-icon-slot
|
|
127
|
+
class="menu-grid-item"
|
|
128
|
+
@click="gotoPage(subItem)"
|
|
129
|
+
>
|
|
130
|
+
<template #icon>
|
|
131
|
+
<view
|
|
132
|
+
class="menu-icon-wrapper flex items-center justify-center"
|
|
133
|
+
:style="{ background: subItem.color }"
|
|
134
|
+
>
|
|
135
|
+
<text class="menu-icon !text-xl iconfont" :class="[subItem.appIcon || 'i-carbon:grid']" />
|
|
136
|
+
<view class="icon-shine" />
|
|
137
|
+
</view>
|
|
138
|
+
</template>
|
|
139
|
+
<template #text>
|
|
140
|
+
<view class="menu-text-wrapper">
|
|
141
|
+
<view class="menu-title text-ellipsis dark:text-white text-gray-800">
|
|
142
|
+
{{ languageStore.t(subItem.title) }}
|
|
143
|
+
</view>
|
|
144
|
+
<!-- <view class="menu-badge" v-if="subIndex === 0">
|
|
145
|
+
<text class="badge-dot" />
|
|
146
|
+
</view> -->
|
|
132
147
|
</view>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
</template>
|
|
149
|
+
</wd-grid-item>
|
|
150
|
+
</wd-grid>
|
|
151
|
+
</view>
|
|
152
|
+
</template>
|
|
153
|
+
</DemoCard>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<template v-else>
|
|
157
|
+
<slot
|
|
158
|
+
name="tile"
|
|
159
|
+
:items="tileItems"
|
|
160
|
+
:goto="gotoPage"
|
|
161
|
+
:t="languageStore.t"
|
|
162
|
+
/>
|
|
163
|
+
</template>
|
|
143
164
|
</view>
|
|
144
165
|
|
|
145
166
|
<!-- 底部信息 -->
|