UNPKG

@zhoucanyu/cc-tools

Version:

基于 Vue 自己封装的一些工具

2 lines 2.16 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0bedf760"],{"6cd2":function(e,n,t){},bae4:function(e,n,t){"use strict";t.r(n);var c=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"debounce-warpper"},[t("h1",[e._v("debounce - 函数防抖指令")]),t("h3",[e._v("点击事件")]),t("div",{staticClass:"btn-warpper"},[t("Button",{directives:[{name:"debounce",rawName:"v-debounce.click",value:function(){return e.defautlOfClick(300)},expression:"() => defautlOfClick(300)",modifiers:{click:!0}}]},[e._v("\n 默认300ms的延迟\n ")]),t("Button",{directives:[{name:"debounce",rawName:"v-debounce.click",value:function(){return e.defautlOfClick(1e3)},expression:"() => defautlOfClick(1000)",modifiers:{click:!0}}]},[e._v("\n 默认1000ms的延迟\n ")]),t("Button",{directives:[{name:"debounce",rawName:"v-debounce.click.event",value:e.eventOfClick,expression:"eventOfClick",modifiers:{click:!0,event:!0}}]},[e._v("获取Event对象")])],1),t("h3",[e._v("输入框事件")]),t("div",{staticClass:"input-warpper"},[t("p",[e._v("\n input获取event :\n "),t("input",{directives:[{name:"debounce",rawName:"v-debounce:400.input.event",value:e.eventOfInput,expression:"eventOfInput",arg:"400",modifiers:{input:!0,event:!0}}],attrs:{type:"text"},domProps:{value:e.text}})]),t("p",[e._v("\n keydown获取event :\n "),t("input",{directives:[{name:"debounce",rawName:"v-debounce.keydown.event",value:e.eventOfInput,expression:"eventOfInput",modifiers:{keydown:!0,event:!0}}],attrs:{type:"text"},domProps:{value:e.text}})])])])},i=[],u=t("3a0d"),o={created:function(){console.log({curry:u["c"],throttle:u["h"],flatten:u["f"],debounce:u["d"]})},data:function(){return{text:"我是bar"}},methods:{defautlOfClick:function(e){var n="默认".concat(e,"ms的延迟");alert(n)},eventOfClick:function(e){console.log(e),alert(e)},eventOfInput:function(e){console.log(e)}}},a=o,r=(t("f0dd"),t("2877")),d=Object(r["a"])(a,c,i,!1,null,"c254802e",null);n["default"]=d.exports},f0dd:function(e,n,t){"use strict";var c=t("6cd2"),i=t.n(c);i.a}}]); //# sourceMappingURL=chunk-0bedf760.31a580ca.js.map