diff --git a/src/components/notice/index.js b/src/components/notice/index.js index 3e7eda9..d089bed 100644 --- a/src/components/notice/index.js +++ b/src/components/notice/index.js @@ -68,7 +68,7 @@ function notice (type, options) { key: noticeKey.toString(), duration: duration, style: {}, - transitionName: 'move-right', + transitionName: 'move-notice', content: content, onClose: onClose, closable: true diff --git a/src/styles/animation/move.less b/src/styles/animation/move.less index efbb670..b622353 100644 --- a/src/styles/animation/move.less +++ b/src/styles/animation/move.less @@ -117,3 +117,45 @@ opacity: 0; } } + +// specific transition for Notice + +.move-motion(move-notice, ivuMoveNotice); +@import '../components/notice.less'; + +@keyframes ivuMoveNoticeIn { + 0% { + opacity: 0; + transform-origin: 0 0; + transform: translateX(100%); + } + 100% { + opacity: 1; + transform-origin: 0 0; + transform: translateX(0%); + } +} + +@keyframes ivuMoveNoticeOut { + 0% { + transform-origin: 0 0; + transform: translateX(0%); + opacity: 1; + } + 70% { + transform-origin: 0 0; + transform: translateX(100%); + height: auto; + padding: @notice-padding; + margin-bottom: @notice-margin-bottom; + opacity: 0; + } + 100% { + transform-origin: 0 0; + transform: translateX(100%); + height: 0; + padding: 0; + margin-bottom: 0; + opacity: 0; + } +} diff --git a/test/app.vue b/test/app.vue index 40eab3f..bad5332 100644 --- a/test/app.vue +++ b/test/app.vue @@ -51,6 +51,7 @@ li + li {
  • Rate
  • Upload
  • Tree
  • +
  • Notice
  • diff --git a/test/main.js b/test/main.js index ec30230..8692017 100644 --- a/test/main.js +++ b/test/main.js @@ -155,6 +155,11 @@ router.map({ require(['./routers/tree.vue'], resolve); } }, + '/notice': { + component: function (resolve) { + require(['./routers/notice.vue'], resolve); + } + }, }); router.beforeEach(function () { diff --git a/test/routers/notice.vue b/test/routers/notice.vue new file mode 100644 index 0000000..21de42d --- /dev/null +++ b/test/routers/notice.vue @@ -0,0 +1,19 @@ + + -- libgit2 0.21.4