mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
487001d697
.demo.md for component demo .demo-entry.md for demo entry .md for common docs
614 B
614 B
Theme Environments
Get current theme environment.
<n-button @click="theme = 'dark'">Dark Theme</n-button>
<n-button @click="theme = 'light'">Light Theme</n-button>
<n-config-provider :theme="theme" :theme-environments="env">
<n-config-consumer v-slot="{ themeEnvironment }">
<n-card>
<n-tag>{{ themeEnvironment }}</n-tag>
</n-card>
</n-config-consumer>
</n-config-provider>
export default {
data () {
return {
theme: 'dark',
env: {
dark: 'NaCl',
light: 'Ionic Compound'
}
}
}
}
.n-button {
margin: 0 8px 12px 0;
}