xyyd-fatfox/src/utils/ThemeProvider.tsx

39 lines
862 B
TypeScript

import { ConfigProvider, theme } from 'ant-design-vue'
import { defineComponent } from 'vue'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
export default defineComponent({
props: {
dark: {
type: Boolean,
default: false
}
},
setup(props, ctx) {
return () => (
<ConfigProvider
theme={{
algorithm: props.dark ? theme.darkAlgorithm : theme.defaultAlgorithm,
token: {
colorPrimary: '#f88e14',
colorBgBase: props.dark ? '#393a41' : '#fff',
colorBorder: 'transparent'
},
components: {
Slider: {
},
Button: {
colorPrimary: '#f88e14'
}
}
}}
locale={zhCN}
>
{ctx.slots.default?.()}
</ConfigProvider>
)
}
})