RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
Vue中的列表过渡



    
    
    
    
    
    


    
        //性能考虑,尽量不用index作为key值 
                     {{item.title}}         
        add     
             var count = 0;         var vm = new Vue({             el: "#root",             data: {                 list: []             },             methods: {                 handBtnClick: function() {                     this.list.push({                         id: count++,                         title: "hello"                     });                 }             }         });     

之前是对单个或多个元素之间做切换动画效果,现在,对一个列表过渡效果,用标签

创新互联专注于海沧企业网站建设,成都响应式网站建设公司,商城网站制作。海沧网站建设公司,为海沧等地区提供建站服务。全流程按需定制制作,专业设计,全程项目跟踪,创新互联专业和态度为您提供的服务




    
    
    
    
    
    
        /*因为没有给它命名,所以用默认v开头的class名*/
        .v-enter, .v-leave-to {
            opacity: 0;
        }
        .v-enter-active, .v-leave-active {
            transition: opacity 1s;
        }
    


    
        //性能考虑,尽量不用index作为key值 
                                      {{item.title}}             
                 add     
             var count = 0;         var vm = new Vue({             el: "#root",             data: {                 list: []             },             methods: {                 handBtnClick: function() {                     this.list.push({                         id: count++,                         title: "hello"                     });                 }             }         });     

为啥上面的效果是增加的都有渐显效果呢?

用一对标签包裹


    

hello

    

hello

    

hello

相当于每一个都用一对标签包裹

    

hello

    

hello

    

hello


网页标题:Vue中的列表过渡
分享URL:http://sczitong.cn/article/jeeeho.html