From da148ac77959b5c8d94955bf7b85ff55a089c55c Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Thu, 31 Mar 2022 13:38:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(docs):=20=E4=BC=98=E5=8C=96=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/src/layouts/Layout.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/example/src/layouts/Layout.vue b/example/src/layouts/Layout.vue index 4baf1580..fc868f7e 100644 --- a/example/src/layouts/Layout.vue +++ b/example/src/layouts/Layout.vue @@ -257,10 +257,17 @@ export default { }); const latestVer = getLayuiVueVersion(); - const layuiVueVersion = computed(() => - latestVer.value - ?? import.meta.env.LAYUI_VUE_VERSION - ) + const layuiVueVersion = computed(() => { + if(!latestVer.value){ + const ver = import.meta.env.LAYUI_VUE_VERSION; + const idx = ver.indexOf("-"); + const isPreRelease = (idx != -1); + if(isPreRelease){ + latestVer.value = ver.substring(0, idx) + } + } + return latestVer.value; + }) watch(isDark, () => { if (isDark.value) { @@ -286,9 +293,9 @@ export default { locale.value = lang; }; - provide('LayuiVueVersion', layuiVueVersion) provide("isDark",isDark); provide("theme",theme); + provide('LayuiVueVersion', layuiVueVersion); return { t,