mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +08:00
doc(element)
This commit is contained in:
parent
bbfcb2da8d
commit
023d1c739c
@ -1,5 +1,5 @@
|
||||
# Basic
|
||||
When Config Provider provides dark theme, it applies `n-dark-theme` class on it. When Config Provider provides light theme, it applies `n-light-theme` class on it. If Neither, it won't apply any additional class on it. Just like other themed Naive UI components.
|
||||
When Config Provider provides dark theme, it applies `n-dark-theme` class on n-element. When Config Provider provides light theme, it applies `n-light-theme` class on it. If Neither, it won't apply any additional class on it. Just like other themed Naive UI components.
|
||||
|
||||
It is very helpful to create themed component.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Style Scheme
|
||||
|
||||
It can also access style scheme.
|
||||
```html
|
||||
<n-element as="div" class="myel">
|
||||
<template v-slot="{ styleScheme }">
|
||||
|
@ -1,7 +1,22 @@
|
||||
# Element
|
||||
Element is similar to Config Consumer but has different class apply to it when theme changes.
|
||||
Element can be render as a custom tag with the ability of accessing some configurations provided by n-config-provider.
|
||||
|
||||
## Demos
|
||||
```demo
|
||||
basic
|
||||
color
|
||||
```
|
||||
## Props
|
||||
|Name|Type|Default|Description|
|
||||
|-|-|-|-|
|
||||
|as|`string`|`'div'`||
|
||||
|
||||
## Slots
|
||||
|Name|Parameters|
|
||||
|-|-|
|
||||
|default|(theme, namespace, themeEnvironment, styleScheme)|
|
||||
|
||||
## Events
|
||||
|Name|Parameters|
|
||||
|-|-|
|
||||
|theme-change|(theme, oldTheme)|
|
||||
|
Loading…
Reference in New Issue
Block a user