naive-ui/demo/documentation/components/config-provider/enUS/theme.demo.md

24 lines
393 B
Markdown
Raw Normal View History

2019-10-12 15:46:02 +08:00
# Theme
Set theme of inner components of `n-config-provider`.
2019-10-12 15:46:02 +08:00
```html
<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>
2019-10-12 15:46:02 +08:00
```
```js
export default {
data () {
return {
theme: 'dark'
}
}
}
```
```css
.n-button {
margin: 0 12px 0 0;
2019-10-12 15:46:02 +08:00
}
```