mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-15 04:42:23 +08:00
26 lines
588 B
Markdown
26 lines
588 B
Markdown
# Basic
|
|
```html
|
|
<n-config-consumer
|
|
@theme-change="handleThemeChange"
|
|
@namespace-change="handleNamespaceChange"
|
|
>
|
|
<template slot-scope="{ theme, namespace }">
|
|
<div>
|
|
<div>theme: {{ theme }}</div>
|
|
<div>namespace: {{ namespace }}</div>
|
|
</div>
|
|
</template>
|
|
</n-config-consumer>
|
|
```
|
|
```js
|
|
export default {
|
|
methods: {
|
|
handleThemeChange (value, oldValue) {
|
|
this.$NMessage.info('Theme Change: `' + value + '` theme')
|
|
},
|
|
handleNamespaceChange (value, oldValue) {
|
|
this.$NMessage.info('Namespace Change: `' + value + '` namespace')
|
|
}
|
|
}
|
|
}
|
|
``` |