diff --git a/build/bin/build-entry.js b/build/bin/build-entry.js index bc1fd8504..279a9d50c 100644 --- a/build/bin/build-entry.js +++ b/build/bin/build-entry.js @@ -11,9 +11,11 @@ var MAIN_TEMPLATE = `/* Automatic generated by './build/bin/build-entry.js' */ {{include}} import locale from 'element-ui/src/locale'; +import CollapseTransition from 'element-ui/src/transitions/collapse-transition'; const components = [ -{{install}} +{{install}}, + CollapseTransition ]; const install = function(Vue, opts = {}) { @@ -47,6 +49,7 @@ module.exports = { locale: locale.use, i18n: locale.i18n, install, + CollapseTransition, Loading, {{list}} }; diff --git a/examples/docs/en-US/popover.md b/examples/docs/en-US/popover.md index 7e68fd0f3..bd6a6e46f 100644 --- a/examples/docs/en-US/popover.md +++ b/examples/docs/en-US/popover.md @@ -215,7 +215,7 @@ Of course, you can nest other operations. It's more light-weight than using a di | disabled | whether Popover is disabled | boolean | — | false | | value(v-model) | whether popover is visible | Boolean | — | false | | offset | popover offset | number | — | 0 | -| transition | popover transition animation | string | — | fade-in-linear | +| transition | popover transition animation | string | — | el-fade-in-linear | | visible-arrow | whether a tooltip arrow is displayed or not. For more info, please refer to [Vue-popper](https://github.com/element-component/vue-popper) | boolean | — | true | | popper-options | parameters for [popper.js](https://popper.js.org/documentation.html) | object | please refer to [popper.js](https://popper.js.org/documentation.html) | `{ boundariesElement: 'body', gpuAcceleration: false }` | | popper-class | custom class name for popover | string | — | — | diff --git a/examples/docs/en-US/tooltip.md b/examples/docs/en-US/tooltip.md index 456f9501c..bcd68a730 100644 --- a/examples/docs/en-US/tooltip.md +++ b/examples/docs/en-US/tooltip.md @@ -160,7 +160,7 @@ Display multiple lines of text and set their format. In addition to basic usages, there are some attributes that allow you to customize your own: -`transition` attribute allows you to customize the animation in which the tooltip shows or hides, and the default value is `fade-in-linear`. +`transition` attribute allows you to customize the animation in which the tooltip shows or hides, and the default value is el-fade-in-linear. `disabled` attribute allows you to disable `tooltip`. You just need set it to `true`. @@ -206,7 +206,7 @@ Disabled form elements are not supported in tooltip, see more information at [MD | value(v-model) | visibility of Tooltip | boolean | — | false | | disabled | whether Tooltip is disabled | boolean | — | false | | offset | offset of the Tooltip | number | — | 0 | -| transition | animation name | string | — | `fade-in-linear` | +| transition | animation name | string | — | el-fade-in-linear | | visible-arrow | whether an arrow is displayed. For more information, check [Vue-popper](https://github.com/element-component/vue-popper) page | boolean | — | true | | popper-options | [popper.js](https://popper.js.org/documentation.html) parameters | Object | refer to [popper.js](https://popper.js.org/documentation.html) doc | `{ boundariesElement: 'body', gpuAcceleration: false }` | | open-delay | delay of appearance, in millisecond | number | — | 0 | diff --git a/examples/docs/en-US/transition.md b/examples/docs/en-US/transition.md new file mode 100644 index 000000000..0847bcec3 --- /dev/null +++ b/examples/docs/en-US/transition.md @@ -0,0 +1,164 @@ +## Built-in transition + +If you want, you can use Element built-in transition directly. Of course you need to know [vue#transition](https://vuejs.org/v2/api/#transition). + +### fade + +:::demo You can use `el-fade-in-linear` and `el-fade-in`. +```html + + + + + +``` +::: + +### zoom + +:::demo You can use `el-zoom-in-center`, `el-zoom-in-top` and `el-zoom-in-bottom`. +```html + + + + + +``` +::: + + +### collapse + +`el-collapse-transition` is a special component that implement collapse transtion. + +:::demo +```html + + + + + +``` +::: + + + + diff --git a/examples/docs/zh-CN/tooltip.md b/examples/docs/zh-CN/tooltip.md index 0d91f9743..0522516e5 100644 --- a/examples/docs/zh-CN/tooltip.md +++ b/examples/docs/zh-CN/tooltip.md @@ -208,7 +208,7 @@ tooltip 内不支持 disabled form 元素,参考[MDN](https://developer.mozill | value(v-model) | 状态是否可见 | Boolean | — | false | | disabled | Tooltip 是否可用 | Boolean | — | false | | offset | 出现位置的偏移量 | Number | — | 0 | -| transition | 定义渐变动画 | String | — | `fade-in-linear` | +| transition | 定义渐变动画 | String | — | el-fade-in-linear | | visible-arrow | 是否显示 Tooltip 箭头,更多参数可见[Vue-popper](https://github.com/element-component/vue-popper) | Boolean | — | true | | popper-options | [popper.js](https://popper.js.org/documentation.html) 的参数 | Object | 参考 [popper.js](https://popper.js.org/documentation.html) 文档 | { boundariesElement: 'body', gpuAcceleration: false } | | open-delay | 延迟出现,单位毫秒 | Number | — | 0 | diff --git a/examples/docs/zh-CN/transition.md b/examples/docs/zh-CN/transition.md new file mode 100644 index 000000000..3e6419abe --- /dev/null +++ b/examples/docs/zh-CN/transition.md @@ -0,0 +1,164 @@ +## 内置过渡动画 + +Element 内应用在部分组件的过渡动画,你也可以直接使用。具体用法参考 [transition 组件](https://cn.vuejs.org/v2/api/#transition)。 + +### fade 淡入淡出 + +:::demo 提供 `el-fade-in-linear` 和 `el-fade-in` 两种效果。 +```html + + + + + +``` +::: + +### zoom 缩放 + +:::demo 提供 `el-zoom-in-center`,`el-zoom-in-top` 和 `el-zoom-in-bottom` 三种效果。 +```html + + + + + +``` +::: + + +### collapse 展开折叠 + +使用 `el-collapse-transition` 组件实现折叠展开效果。 + +:::demo +```html + + + + + +``` +::: + + + + diff --git a/examples/nav.config.json b/examples/nav.config.json index 307ce835e..5d86bbdaa 100644 --- a/examples/nav.config.json +++ b/examples/nav.config.json @@ -18,6 +18,10 @@ { "path": "/custom-theme", "name": "自定义主题" + }, + { + "path": "/transition", + "name": "内置过渡动画" } ] }, @@ -248,6 +252,10 @@ { "path": "/custom-theme", "name": "Custom Theme" + }, + { + "path": "/transition", + "name": "Built-in transition" } ] }, diff --git a/packages/collapse/src/collapse-item.vue b/packages/collapse/src/collapse-item.vue index a5bd5ed66..c64a63c49 100644 --- a/packages/collapse/src/collapse-item.vue +++ b/packages/collapse/src/collapse-item.vue @@ -4,18 +4,17 @@ {{title}} - +
-
+