doc(config-provider): use os theme

This commit is contained in:
07akioni 2020-06-03 13:56:46 +08:00
parent df093103a9
commit a457b75e0e
4 changed files with 20 additions and 0 deletions

View File

@ -6,6 +6,7 @@ theme
namespace
inherit-theme
theme-environment
os-theme
language
transparent
```

View File

@ -0,0 +1,9 @@
# Use OS Theme
Naive-ui provides `$NOs.theme` property to get the current theme of your OS.
```html
<n-config-provider :theme="$NOs.theme">
<n-card>
Your current system theme is {{ JSON.stringify($NOs.theme) }}.
</n-card>
</n-config-provider>
```

View File

@ -6,6 +6,7 @@ theme
namespace
inherit-theme
theme-environment
os-theme
language
transparent
```

View File

@ -0,0 +1,9 @@
# 使用操作系统主题
Naive-ui 提供 `$NOs.theme` 属性来获取当前操作系统的主题。
```html
<n-config-provider :theme="$NOs.theme">
<n-card>
当前操作系统的主题是 {{ JSON.stringify($NOs.theme) }}。
</n-card>
</n-config-provider>
```