mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
docs(theme): Upgrade the use case of theme to Composition API (#1131)
This commit is contained in:
parent
1e2ca008ff
commit
336fcf98c3
6
demo/pages/docs/theme/enUS/element.demo.md
vendored
6
demo/pages/docs/theme/enUS/element.demo.md
vendored
@ -22,15 +22,15 @@ Naive UI has `n-element` component. See [Element](../components/element).
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { ref } from 'vue'
|
import { defineComponent, ref } from 'vue'
|
||||||
import { darkTheme } from 'naive-ui'
|
import { darkTheme } from 'naive-ui'
|
||||||
|
|
||||||
export default {
|
export default defineComponent({
|
||||||
setup () {
|
setup () {
|
||||||
return {
|
return {
|
||||||
darkTheme,
|
darkTheme,
|
||||||
theme: ref(null)
|
theme: ref(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
```
|
```
|
||||||
|
@ -14,15 +14,15 @@ Use `n-config-provider` to set the theme of all its descedant components.
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { ref } from 'vue'
|
import { defineComponent, ref } from 'vue'
|
||||||
import { darkTheme } from 'naive-ui'
|
import { darkTheme } from 'naive-ui'
|
||||||
|
|
||||||
export default {
|
export default defineComponent({
|
||||||
setup () {
|
setup () {
|
||||||
return {
|
return {
|
||||||
darkTheme,
|
darkTheme,
|
||||||
theme: ref(null)
|
theme: ref(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
```
|
```
|
||||||
|
6
demo/pages/docs/theme/zhCN/element.demo.md
vendored
6
demo/pages/docs/theme/zhCN/element.demo.md
vendored
@ -22,15 +22,15 @@ Naive UI 提供 `n-element` 组件,参考 [Element](../components/element)。
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { ref } from 'vue'
|
import { defineComponent, ref } from 'vue'
|
||||||
import { darkTheme } from 'naive-ui'
|
import { darkTheme } from 'naive-ui'
|
||||||
|
|
||||||
export default {
|
export default defineComponent({
|
||||||
setup () {
|
setup () {
|
||||||
return {
|
return {
|
||||||
darkTheme,
|
darkTheme,
|
||||||
theme: ref(null)
|
theme: ref(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
```
|
```
|
||||||
|
@ -14,15 +14,15 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { ref } from 'vue'
|
import { defineComponent, ref } from 'vue'
|
||||||
import { darkTheme } from 'naive-ui'
|
import { darkTheme } from 'naive-ui'
|
||||||
|
|
||||||
export default {
|
export default defineComponent({
|
||||||
setup () {
|
setup () {
|
||||||
return {
|
return {
|
||||||
darkTheme,
|
darkTheme,
|
||||||
theme: ref(null)
|
theme: ref(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user