diff --git a/src/components/uh-article-vote-item/uh-article-vote-item.vue b/src/components/uh-article-vote-item/uh-article-vote-item.vue index 5034223..5e0f3f5 100644 --- a/src/components/uh-article-vote-item/uh-article-vote-item.vue +++ b/src/components/uh-article-vote-item/uh-article-vote-item.vue @@ -104,8 +104,10 @@ function handleSelectCheckboxOption(option: IVoteOption) { return const checkedList = (spec.options || []).filter(x => x.checked && x.id !== option.id) - if (spec.type === 'multiple' && checkedList.length >= (spec.maxVotes || 0)) { - showToast(`最多选择 ${spec.maxVotes} 项`) + // maxVotes 缺失(0/undefined)时不限制多选数量,避免 0 >= 0 恒真导致无法选择 + const maxVotes = spec.maxVotes + if (spec.type === 'multiple' && maxVotes && maxVotes > 0 && checkedList.length >= maxVotes) { + showToast(`最多选择 ${maxVotes} 项`) return } @@ -225,7 +227,7 @@ defineExpose({ refresh: handleGetData }) 查看投票详情 > - + {{ voteData.spec?.title }} @@ -247,8 +249,12 @@ defineExpose({ refresh: handleGetData }) > - {{ option.title }} - {{ handleCalcPercent(option) }}% + + {{ option.title }} + + + {{ handleCalcPercent(option) }}% + @@ -278,8 +284,12 @@ defineExpose({ refresh: handleGetData }) > - {{ option.title }} - {{ handleCalcPercent(option) }}% + + {{ option.title }} + + + {{ handleCalcPercent(option) }}% + @@ -300,7 +310,7 @@ defineExpose({ refresh: handleGetData }) - + - 选项{{ optionIndex + 1 }}:{{ option.title }} - {{ handleCalcPercent(option) }}% + + 选项{{ optionIndex + 1 }}:{{ option.title }} + + + {{ handleCalcPercent(option) }}% + diff --git a/src/components/uh-navbar/uh-navbar.vue b/src/components/uh-navbar/uh-navbar.vue index 1b7ff8f..ad70e9a 100644 --- a/src/components/uh-navbar/uh-navbar.vue +++ b/src/components/uh-navbar/uh-navbar.vue @@ -10,12 +10,15 @@ titleColor ?: string; scrollTitle ?: string; needPlaceholder ?: boolean; + backClass ?: string; + backStyle ?: string; } const props = withDefaults(defineProps(), { useBack: true, useTitle: true, needPlaceholder: true, + backClass: 'text-gray-900' }) const slots = useSlots() @@ -35,10 +38,6 @@ const customCalss = computed(() => { const _class = [] - if (props.titleColor) { - _class.push(props.titleColor) - return - } if (scrollThreshold.value) { _class.push('text-white') } @@ -48,6 +47,10 @@ return _class; }) + const titleColorClass = computed(() => { + return [props.titleColor] + }) + const visibleTitle = computed(() => { if (!props.scrollTitle) { return props.defaultTitle; @@ -65,7 +68,7 @@ return [ homePage, 'pages/maintenance/maintenance', - ...tabbarList.map(item => item.pagePath), + ...tabbarList.map((item : any) => item.pagePath), ] as string[]; }) @@ -92,14 +95,16 @@ + class="uh-global-card-glass h-7 px-3 rounded-full border flex items-center gap-x-2 text-sm" + :class="props.backClass" :style="[props.backStyle]"> 返回 - + {{visibleTitle}} diff --git a/src/components/uh-scroll-top/uh-scroll-top.vue b/src/components/uh-scroll-top/uh-scroll-top.vue index 701ae4f..8f9a8f6 100644 --- a/src/components/uh-scroll-top/uh-scroll-top.vue +++ b/src/components/uh-scroll-top/uh-scroll-top.vue @@ -13,7 +13,7 @@ } // 获取当前页面,并且设置黑名单模式,因为有的页面可能不需要滚动到顶部 - const balckList = ['pages/maintenance/maintenance','pages-blog/setting/setting'] + const balckList = ['pages/maintenance/maintenance', 'pages-blog/setting/setting', 'pages-blog/love/love'] const pages = getCurrentPages() const currentPage = pages[pages.length - 1] const visible = computed(() => { @@ -23,8 +23,7 @@