💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ## 主题 ### 自定义主题 ``` import { createApp } from 'vue' import { createVuetify, ThemeDefinition } from 'vuetify' const myCustomLightTheme = { dark: false, colors: { background: '#FFFFFF', surface: '#FFFFFF', primary: '#6200EE', 'primary-darken-1': '#3700B3', secondary: '#03DAC6', 'secondary-darken-1': '#018786', error: '#B00020', info: '#2196F3', success: '#4CAF50', warning: '#FB8C00', }, } export default createVuetify({ theme: { defaultTheme: 'myCustomLightTheme', themes: { myCustomLightTheme, }, }, }) ``` ### 更改主题 ``` import {useTheme} from "vuetify" const theme = useTheme() theme.global.name.value = theme.global.current.value.dark ? 'light' :'dark' ``` ### 自定义颜色,并使用 ``` themes: { light: { colors: { primary: '#1867C0', secondary: '#5CBBF6', foo:'#fc2b2b', }, }, ``` 使用 ``` .foo{ color: rgb(var(--v-theme-success)); // --v-theme-success 为框架自带颜色, background-color: rgb(var(--v-theme-foo)); // --v-theme-foo 为自定义颜色 } ``` ## 在类中使用 ``` <div class="bg-foo on-foo"> ```