doc(element)

This commit is contained in:
07akioni 2020-01-27 16:26:38 +08:00
parent bbfcb2da8d
commit 023d1c739c
3 changed files with 18 additions and 3 deletions

View File

@ -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.

View File

@ -1,5 +1,5 @@
# Style Scheme
It can also access style scheme.
```html
<n-element as="div" class="myel">
<template v-slot="{ styleScheme }">

View File

@ -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)|