如何更改暗黑/明亮模式 ?
- 【步骤】1 -
pages.json
json
{
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "Turbo UI",
"navigationBarBackgroundColor": "@navigationBarBackgroundColor",
"backgroundColor": "@backgroundColor",
"backgroundColorContent": "@backgroundColor",
"navigationStyle": "custom"
},
"tabBar": {
"color": "@tabBarColor",
"selectedColor": "@tabBarSelectColor",
"fontSize": "13px",
"borderStyle": "@tabBarBorderColor",
"backgroundColor": "@tabBarBackgroundColor",
"list": [
{
"pagePath": "pages/index/index",
"text": "组件"
},
{
"pagePath": "pages/template/template",
"text": "模板"
}
]
}
}
- 【步骤】2
ts
import { setTheme } from '@/uni_modules/turbo-ui/index.uts'
// "auto" | "light" | "dark"
setTheme("light")