File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 },
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff 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
160165router . beforeEach ( function ( ) {
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments