naive-ui/demo/documentation/components/config-provider/enUS/theme.demo.md
2020-09-03 16:45:52 +08:00

393 B

Theme

Set theme of inner components of n-config-provider.

<n-config-provider :theme="theme">
  <n-card>
    <n-button @click="theme = 'dark'">Dark</n-button>
    <n-button @click="theme = 'light'">Light</n-button>
  </n-card>
</n-config-provider>
export default {
  data () {
    return {
      theme: 'dark'
    }
  }
}
.n-button {
  margin: 0 12px 0 0;
}