naive-ui/demo/documentation/components/configProvider/enUS/theme.md
2019-11-09 22:45:07 +08:00

352 B

Theme

Set theme of inner components of app.

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