diff --git a/docs/vue2.md b/docs/vue2.md index b735adf..8157421 100644 --- a/docs/vue2.md +++ b/docs/vue2.md @@ -1538,6 +1538,289 @@ Vue.component('alert-box', { - ` + + +``` + +### CSS 过渡 + + +```html + + + +``` + +### CSS 动画 + + +```html + + + +``` + +### 过渡的类名 + + +:- | :- +:- | :- +`v-enter` | 定义进入过渡的开始状态 [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#过渡的类名) +`v-enter-active` | 定义进入过渡生效时的状态 [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#过渡的类名) +`v-enter-to` _(2.1.8)_ | 定义进入过渡的结束状态 [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#过渡的类名) +`v-leave` | 定义离开过渡的开始状态 [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#过渡的类名) +`v-leave-active` | 定义离开过渡生效时的状态 [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#过渡的类名) +`v-leave-to` _(2.1.8)_| 定义离开过渡的结束状态 [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#过渡的类名) + +如果你使用了 ``,那么 `v-enter` 会替换为 `my-tran-enter`。 + +#### 自定义过渡的类名 + +:- | :- +:- | :- +`enter-class` | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名) +`enter-active-class` | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名) +`enter-to-class` _(2.1.8+)_ | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名) +`leave-class` | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名) +`leave-active-class` | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名) +`leave-to-class` _(2.1.8+)_ | [#](https://v2.cn.vuejs.org/v2/guide/transitions.html#自定义过渡的类名) + +---- + +```html + +

hello

+
+``` + +### 显性的过渡持续时间 + +`` 组件上的 `duration` prop 定制一个显性的过渡持续时间 (以毫秒计): + +```html + + ... + +``` + +你也可以定制进入和移出的持续时间: + +```html + + ... + +``` + +### 初始渲染的过渡 + + +可以通过 `appear` attribute 设置节点在初始渲染的过渡 + +```html + + + +``` + +这里默认和进入/离开过渡一样,同样也可以自定义 CSS 类名 + +```html + + + +``` + +自定义 JavaScript 钩子: + +```html + + + +``` + +无论是 `appear` attribute 还是 `v-on:appear` 钩子都会生成初始渲染过渡 + +### JavaScript 钩子 + +```html + + + +``` + +钩子函数可以结合 CSS `transitions`/`animations` 使用,也可以单独使用 + +### 列表的进入/离开过渡 + + +```html + + + +``` + Vue 2 API 参考 --- diff --git a/scripts/style.css b/scripts/style.css index 3ac5da9..2d4bcc8 100644 --- a/scripts/style.css +++ b/scripts/style.css @@ -653,7 +653,7 @@ body:not(.home) .h2wrap > h2 a::after { border-bottom: 0; } -.h3wrap hr { +.h3wrap hr, .h3wrap-body hr { border-bottom: 1px solid var(--color-border-default); }