[Improvement] Reorganize document (#1066)

This commit is contained in:
neverland
2018-05-15 10:39:01 +08:00
committed by GitHub
parent b1142fd862
commit e8aad7246c
124 changed files with 181 additions and 186 deletions

View File

@@ -0,0 +1,48 @@
## Built-in Style
Vant contains some common styles that can be used directly by the className.
### Text ellipsis
When the text content length exceeds the maximum container width, the excess text is automatically omitted.
```html
<div class="van-ellipsis">
This is a paragraph of 250px width limit, the back will be omitted.
</div>
```
### Hairline
Add 1px border under the Retina screen for the element, based on a pseudo element.
```html
<!-- border top -->
<div class="van-hairline--top"></div>
<!-- border bottom -->
<div class="van-hairline--bottom"></div>
<!-- border left -->
<div class="van-hairline--left"></div>
<!-- border right -->
<div class="van-hairline--right"></div>
<!-- border top & bottom -->
<div class="van-hairline--top-bottom"></div>
<!-- full border -->
<div class="van-hairline--surround"></div>
```
### Animation
```html
<!-- fade in -->
<transition name="van-fade">
<div v-show="visible">Fade</div>
</transition>
<!-- slide bottom -->
<transition name="van-slide-bottom">
<div v-show="visible">Fade</div>
</transition>
```

View File

@@ -0,0 +1,47 @@
## 内置样式
Vant 中默认包含了一些常用样式,可以直接通过 className 的方式使用。
### 文字省略
当文本内容长度超过容器最大宽度时,自动省略多余的文本。
```html
<div class="van-ellipsis">这是一段宽度限制 250px 的文字,后面的内容会省略</div>
```
### 1px 边框
为元素添加 Retina 屏幕下的 1px 边框(即 hairline基于伪类 transform 实现。
```html
<!-- 上边框 -->
<div class="van-hairline--top"></div>
<!-- 下边框 -->
<div class="van-hairline--bottom"></div>
<!-- 左边框 -->
<div class="van-hairline--left"></div>
<!-- 右边框 -->
<div class="van-hairline--right"></div>
<!-- 上下边框 -->
<div class="van-hairline--top-bottom"></div>
<!-- 全边框 -->
<div class="van-hairline--surround"></div>
```
### 动画
可以通过 `transition` 组件使用内置的动画
```html
<!-- 淡入 -->
<transition name="van-fade">
<div v-show="visible">Fade</div>
</transition>
<!-- 下滑 -->
<transition name="van-slide-bottom">
<div v-show="visible">Fade</div>
</transition>
```