chore(s-layout): 支持定义顶部导航栏背景颜色

pull/180/head
zhangfengchen 2026-05-21 14:46:49 +08:00
parent 0533985189
commit 014b0dd508
1 changed files with 9 additions and 3 deletions

View File

@ -12,6 +12,7 @@
:color="color" :color="color"
:tools="tools" :tools="tools"
:opacityBgUi="opacityBgUi" :opacityBgUi="opacityBgUi"
:backgroundColor="navbarBackgroundColor"
@search="(e) => emits('search', e)" @search="(e) => emits('search', e)"
:defaultSearch="defaultSearch" :defaultSearch="defaultSearch"
/> />
@ -80,6 +81,11 @@
type: String, type: String,
default: 'bg-white', default: 'bg-white',
}, },
// navbar === 'normal'
navbarBackgroundColor: {
type: String,
default: '',
},
color: { color: {
type: String, type: String,
default: '', default: '',
@ -213,16 +219,16 @@
// #endif // #endif
// 使 onMounted 使 onShow // 使 onMounted 使 onShow
onMounted(()=>{ onMounted(() => {
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "", title: '',
}); });
// #endif // #endif
if (!isEmpty(shareInfo.value)) { if (!isEmpty(shareInfo.value)) {
sheep.$platform.share.updateShareInfo(shareInfo.value); sheep.$platform.share.updateShareInfo(shareInfo.value);
} }
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>