Skip to content

设置主题颜色,不同页面页眉颜色不一致 #1157

Discussion options

You must be logged in to vote

// composables/useTheme.ts

    /* 设置导航栏颜色 */
    useNavigationBarColor(color?: {
      frontColor?: string
      backgroundColor?: string
    }) {
      onShow(() => {
        uni.setNavigationBarColor({
          frontColor: color?.frontColor ?? this.theme === 'light' ? '#000000' : '#ffffff',
          backgroundColor: color?.backgroundColor ?? this.theme === 'light' ? '#f3f4f6' : '#212121',
        })
      })
    },

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by woyaodangrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant