Skip to content

Commit b55bac0

Browse files
committed
chore: update
1 parent 628a1f9 commit b55bac0

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/components/Header.vue

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,9 @@ interface Version {
2727
active: string
2828
}
2929
30-
const currentLib = ref('layuiVue')
3130
const libs = ['layuiVue', 'layui']
3231
33-
// FIXME 临时的兼容方法
34-
if (window.location.search.includes('deps=layui')) {
35-
currentLib.value = 'layui'
36-
}
37-
38-
const versions = reactive<Record<VersionKey, Version>>({
32+
const versions = reactive<Record<Exclude<VersionKey, 'layui'>, Version>>({
3933
layuiVue: {
4034
text: 'layui-vue',
4135
published: getSupportedLayuiVueVersions(),
@@ -53,7 +47,7 @@ const versions = reactive<Record<VersionKey, Version>>({
5347
},
5448
})
5549
56-
const versionsLayui = reactive<Record<VersionKey, Version>>({
50+
const versionsLayui = reactive<Record<Extract<VersionKey, 'layui'>, Version>>({
5751
layui: {
5852
text: 'layui',
5953
published: getSupportedLayuiVersions(),
@@ -62,7 +56,7 @@ const versionsLayui = reactive<Record<VersionKey, Version>>({
6256
})
6357
6458
async function setVersion(key: VersionKey, v: string) {
65-
const _versions = currentLib.value === 'layuiVue' ? versions : versionsLayui
59+
const _versions = store.libName === 'layuiVue' ? versions : versionsLayui
6660
6761
_versions[key].active = `loading...`
6862
await store.setVersion(key, v)
@@ -111,7 +105,7 @@ function refreshView() {
111105

112106
<div flex="~ gap-2" items-center>
113107
<lay-select
114-
v-model="currentLib"
108+
:model-value="store.libName"
115109
size="xs"
116110
@update:model-value="toggleLib()"
117111
>
@@ -120,7 +114,9 @@ function refreshView() {
120114
</lay-select-option>
121115
</lay-select>
122116
<div
123-
v-for="(v, key) of currentLib === 'layuiVue' ? versions : versionsLayui"
117+
v-for="(v, key) of store.libName === 'layuiVue'
118+
? versions
119+
: versionsLayui"
124120
:key="key"
125121
flex="~ gap-2"
126122
items-center

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy