Skip to content

Commit d8de604

Browse files
authored
Merge pull request view-design#273 from rijn/253
IE<=11 do not support toString.
2 parents 38646a1 + be0769d commit d8de604

6 files changed

Lines changed: 69 additions & 2 deletions

File tree

src/components/carousel/carousel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
type: [String, Number],
7474
default: 'auto',
7575
validator (value) {
76-
return value === 'auto' || toString.call(value) === '[object Number]';
76+
return value === 'auto' || Object.prototype.toString.call(value) === '[object Number]';
7777
}
7878
}
7979
},

src/components/notice/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function notice (type, options) {
6868
key: noticeKey.toString(),
6969
duration: duration,
7070
style: {},
71-
transitionName: 'move-right',
71+
transitionName: 'move-notice',
7272
content: content,
7373
onClose: onClose,
7474
closable: true

src/styles/animation/move.less

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,45 @@
117117
opacity: 0;
118118
}
119119
}
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ li + li {
5151
<li><a v-link="'/rate'">Rate</a></li>
5252
<li><a v-link="'/upload'">Upload</a></li>
5353
<li><a v-link="'/tree'">Tree</a></li>
54+
<li><a v-link="'/notice'">Notice</a></li>
5455
</ul>
5556
</nav>
5657
<router-view></router-view>

test/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ router.map({
155155
require(['./routers/tree.vue'], resolve);
156156
}
157157
},
158+
'/notice': {
159+
component: function (resolve) {
160+
require(['./routers/notice.vue'], resolve);
161+
}
162+
},
158163
});
159164

160165
router.beforeEach(function () {

test/routers/notice.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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>

0 commit comments

Comments
 (0)