< div class = " scrollList" >
< div v-for = " (item,index) in chainlist" :key = " index" >
< div> {{item.name}}</ div>
< div > {{item.age}}</ div>
< div > {{item.address}}</ div>
</ div>
</ div>
.scrollList {
height : 820px;
position : absolute;
top : 0px;
overflow : hidden;
}
data ( ) {
return {
ii: 1 ,
chainlist: [ ] ,
} ;
} ,
var result = JSON . parse ( localStorage. getItem ( "newList" ) ) ;
if (
result
? result[ 0 ]
? result[ 0 ] . id!= res. data. data[ 0 ] . id
: false
: false
) {
result. unshift ( res. data. data[ 0 ] ) ;
this . chainlist = result;
this . ii++ ;
var style = document. styleSheets[ 0 ] ;
$ ( ".scrollList" ) . css ( {
"animation-duration" : "3s" ,
"animation-name" : "bomb" + this . ii,
} ) ;
style. insertRule (
"@keyframes bomb" +
this . ii +
"{0%{ top:-150px;height:970px} 100% {top:0px;height:820px }}" ,
this . ii
) ;
}
localStorage. setItem ( "newList" , JSON . stringify ( res. data. data) ) ;