Commit d8de604ff5e8d90630697d06a41cd7d55befda08
Committed by
GitHub
Merge pull request #273 from rijn/253
IE<=11 do not support toString.
Showing
6 changed files
with
69 additions
and
2 deletions
Show diff stats
src/components/carousel/carousel.vue
... | ... | @@ -73,7 +73,7 @@ |
73 | 73 | type: [String, Number], |
74 | 74 | default: 'auto', |
75 | 75 | validator (value) { |
76 | - return value === 'auto' || toString.call(value) === '[object Number]'; | |
76 | + return value === 'auto' || Object.prototype.toString.call(value) === '[object Number]'; | |
77 | 77 | } |
78 | 78 | } |
79 | 79 | }, | ... | ... |
src/components/notice/index.js
src/styles/animation/move.less
... | ... | @@ -117,3 +117,45 @@ |
117 | 117 | opacity: 0; |
118 | 118 | } |
119 | 119 | } |
120 | + | |
121 | +// specific transition for Notice | |
122 | + | |
123 | +.move-motion(move-notice, ivuMoveNotice); | |
124 | +@import '../components/notice.less'; | |
125 | + | |
126 | +@keyframes ivuMoveNoticeIn { | |
127 | + 0% { | |
128 | + opacity: 0; | |
129 | + transform-origin: 0 0; | |
130 | + transform: translateX(100%); | |
131 | + } | |
132 | + 100% { | |
133 | + opacity: 1; | |
134 | + transform-origin: 0 0; | |
135 | + transform: translateX(0%); | |
136 | + } | |
137 | +} | |
138 | + | |
139 | +@keyframes ivuMoveNoticeOut { | |
140 | + 0% { | |
141 | + transform-origin: 0 0; | |
142 | + transform: translateX(0%); | |
143 | + opacity: 1; | |
144 | + } | |
145 | + 70% { | |
146 | + transform-origin: 0 0; | |
147 | + transform: translateX(100%); | |
148 | + height: auto; | |
149 | + padding: @notice-padding; | |
150 | + margin-bottom: @notice-margin-bottom; | |
151 | + opacity: 0; | |
152 | + } | |
153 | + 100% { | |
154 | + transform-origin: 0 0; | |
155 | + transform: translateX(100%); | |
156 | + height: 0; | |
157 | + padding: 0; | |
158 | + margin-bottom: 0; | |
159 | + opacity: 0; | |
160 | + } | |
161 | +} | ... | ... |
test/app.vue
test/main.js
... | ... | @@ -155,6 +155,11 @@ router.map({ |
155 | 155 | require(['./routers/tree.vue'], resolve); |
156 | 156 | } |
157 | 157 | }, |
158 | + '/notice': { | |
159 | + component: function (resolve) { | |
160 | + require(['./routers/notice.vue'], resolve); | |
161 | + } | |
162 | + }, | |
158 | 163 | }); |
159 | 164 | |
160 | 165 | router.beforeEach(function () { | ... | ... |
1 | +<template> | |
2 | + <i-button @click="pop">Pop</i-button> | |
3 | +</template> | |
4 | +<script> | |
5 | + export default { | |
6 | + methods: { | |
7 | + pop () { | |
8 | + for (let i = 0; i < 6; i++) { | |
9 | + setTimeout(() => { | |
10 | + this.$Notice.open({ | |
11 | + title: 'test', | |
12 | + duration: 1.5 + i | |
13 | + }); | |
14 | + }, i * 500); | |
15 | + } | |
16 | + } | |
17 | + } | |
18 | + } | |
19 | +</script> | ... | ... |