Vue扩展

效果扩展:

Vue.transition('transitionName',{

    beforeEnter:function(){

    },
    enter:function(){

    },
    afterEnter:function(){

    },
    beforeLeave:function(){

    },
    leave:function(){

    },
    afterLeave:function(){

    }
})

组件扩展:

var componentEle = Vue.extend({

    name:'',
    template:''
})

Vue.component('componentName',{

    el:function(){

    },
    date:function(){

    },
    template:''
})

指令扩展:

Vue.directive('directiveName',{

    bind:function(){

    },
    update:function(newValue,oldValue){

    },
    unbind:function(){

    }
})

Vue.elementDirective('directiveTagName',{

    bind:function(){

    },
    update:function(newValue,oldValue){

    },
    unbind:function(){

    }
})

过滤器扩展

Vue.filter('filterName',{
    //read(默认)不会修改数据模型中的值;
    //只是在把来自数据模型的值显示在视图之前转换它
    read:function(value,arguments){

    },
    // (可选)在写回数据之前格式化值
    write:function(value,oldValue){

    }
})

关键字:vue.js, JavaScript, function, vue


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部