@nutui/nutui 2.3.13 → 2.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/.DS_Store +0 -0
- package/dist/nutui.css +1 -1
- package/dist/nutui.js +2380 -518
- package/dist/nutui.js.map +1 -1
- package/dist/nutui.min.css +1 -1
- package/dist/nutui.min.js +3 -3
- package/dist/nutui.min.js.map +1 -1
- package/dist/packages/.DS_Store +0 -0
- package/dist/packages/actionsheet/actionsheet.css +1 -1
- package/dist/packages/actionsheet/actionsheet.js +2 -2
- package/dist/packages/actionsheet/actionsheet.js.map +1 -1
- package/dist/packages/address/address.css +1 -1
- package/dist/packages/address/address.js +2 -2
- package/dist/packages/address/address.js.map +1 -1
- package/dist/packages/avatar/avatar.css +1 -1
- package/dist/packages/avatar/avatar.js +2 -2
- package/dist/packages/avatar/avatar.js.map +1 -1
- package/dist/packages/backtop/backtop.css +1 -1
- package/dist/packages/backtop/backtop.js +2 -2
- package/dist/packages/backtop/backtop.js.map +1 -1
- package/dist/packages/badge/badge.css +1 -1
- package/dist/packages/badge/badge.js +2 -2
- package/dist/packages/badge/badge.js.map +1 -1
- package/dist/packages/button/button.css +1 -1
- package/dist/packages/button/button.js +2 -2
- package/dist/packages/button/button.js.map +1 -1
- package/dist/packages/buttongroup/buttongroup.css +1 -1
- package/dist/packages/buttongroup/buttongroup.js +2 -2
- package/dist/packages/buttongroup/buttongroup.js.map +1 -1
- package/dist/packages/calendar/calendar.css +1 -1
- package/dist/packages/calendar/calendar.js +2 -2
- package/dist/packages/calendar/calendar.js.map +1 -1
- package/dist/packages/cell/cell.css +1 -1
- package/dist/packages/cell/cell.js +2 -2
- package/dist/packages/cell/cell.js.map +1 -1
- package/dist/packages/checkbox/checkbox.css +1 -1
- package/dist/packages/checkbox/checkbox.js +2 -2
- package/dist/packages/checkbox/checkbox.js.map +1 -1
- package/dist/packages/checkboxgroup/checkboxgroup.css +1 -1
- package/dist/packages/checkboxgroup/checkboxgroup.js +2 -2
- package/dist/packages/checkboxgroup/checkboxgroup.js.map +1 -1
- package/dist/packages/checkboxgroup/checkboxgroup.vue +6 -1
- package/dist/packages/circleprogress/circleprogress.css +1 -1
- package/dist/packages/circleprogress/circleprogress.js +2 -2
- package/dist/packages/circleprogress/circleprogress.js.map +1 -1
- package/dist/packages/col/col.css +1 -1
- package/dist/packages/col/col.js +2 -2
- package/dist/packages/col/col.js.map +1 -1
- package/dist/packages/collapse/collapse.css +1 -1
- package/dist/packages/collapse/collapse.js +2 -2
- package/dist/packages/collapse/collapse.js.map +1 -1
- package/dist/packages/collapseitem/collapseitem.css +1 -1
- package/dist/packages/collapseitem/collapseitem.js +2 -2
- package/dist/packages/collapseitem/collapseitem.js.map +1 -1
- package/dist/packages/collapseitem/collapseitem.vue +14 -2
- package/dist/packages/countdown/countdown.css +1 -1
- package/dist/packages/countdown/countdown.js +2 -2
- package/dist/packages/countdown/countdown.js.map +1 -1
- package/dist/packages/countup/countup.css +1 -1
- package/dist/packages/countup/countup.js +2 -2
- package/dist/packages/countup/countup.js.map +1 -1
- package/dist/packages/coupon/coupon.css +1 -1
- package/dist/packages/coupon/coupon.js +2 -2
- package/dist/packages/coupon/coupon.js.map +1 -1
- package/dist/packages/datepicker/datepicker.css +1 -1
- package/dist/packages/datepicker/datepicker.js +2 -2
- package/dist/packages/datepicker/datepicker.js.map +1 -1
- package/dist/packages/dialog/dialog.css +1 -1
- package/dist/packages/dialog/dialog.js +2 -2
- package/dist/packages/dialog/dialog.js.map +1 -1
- package/dist/packages/drag/drag.css +1 -1
- package/dist/packages/drag/drag.js +2 -2
- package/dist/packages/drag/drag.js.map +1 -1
- package/dist/packages/elevator/elevator.css +1 -1
- package/dist/packages/elevator/elevator.js +2 -2
- package/dist/packages/elevator/elevator.js.map +1 -1
- package/dist/packages/fixednav/fixednav.css +1 -1
- package/dist/packages/fixednav/fixednav.js +2 -2
- package/dist/packages/fixednav/fixednav.js.map +1 -1
- package/dist/packages/flex/flex.css +1 -1
- package/dist/packages/flex/flex.js +2 -2
- package/dist/packages/flex/flex.js.map +1 -1
- package/dist/packages/icon/icon.css +1 -1
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +1 -1
- package/dist/packages/imagepicker/imagepicker.css +1 -1
- package/dist/packages/imagepicker/imagepicker.js +2 -2
- package/dist/packages/imagepicker/imagepicker.js.map +1 -1
- package/dist/packages/infiniteloading/infiniteloading.css +1 -1
- package/dist/packages/infiniteloading/infiniteloading.js +2 -2
- package/dist/packages/infiniteloading/infiniteloading.js.map +1 -1
- package/dist/packages/lazyload/lazyload.css +1 -1
- package/dist/packages/lazyload/lazyload.js +3 -3
- package/dist/packages/lazyload/lazyload.js.map +1 -1
- package/dist/packages/leftslip/leftslip.css +1 -1
- package/dist/packages/leftslip/leftslip.js +2 -2
- package/dist/packages/leftslip/leftslip.js.map +1 -1
- package/dist/packages/luckdraw/luckdraw.css +1 -1
- package/dist/packages/luckdraw/luckdraw.js +2 -2
- package/dist/packages/luckdraw/luckdraw.js.map +1 -1
- package/dist/packages/luckycard/luckycard.css +1 -1
- package/dist/packages/luckycard/luckycard.js +2 -2
- package/dist/packages/luckycard/luckycard.js.map +1 -1
- package/dist/packages/magic/magic.css +1 -1
- package/dist/packages/magic/magic.js +2 -2
- package/dist/packages/magic/magic.js.map +1 -1
- package/dist/packages/menu/menu.css +1 -1
- package/dist/packages/menu/menu.js +2 -2
- package/dist/packages/menu/menu.js.map +1 -1
- package/dist/packages/navbar/navbar.css +1 -1
- package/dist/packages/navbar/navbar.js +2 -2
- package/dist/packages/navbar/navbar.js.map +1 -1
- package/dist/packages/ninegrid/ninegrid.css +1 -1
- package/dist/packages/ninegrid/ninegrid.js +2 -2
- package/dist/packages/ninegrid/ninegrid.js.map +1 -1
- package/dist/packages/noticebar/noticebar.css +1 -1
- package/dist/packages/noticebar/noticebar.js +2 -2
- package/dist/packages/noticebar/noticebar.js.map +1 -1
- package/dist/packages/notify/notify.css +1 -1
- package/dist/packages/notify/notify.js +2 -2
- package/dist/packages/notify/notify.js.map +1 -1
- package/dist/packages/numberkeyboard/numberkeyboard.css +1 -1
- package/dist/packages/numberkeyboard/numberkeyboard.js +2 -2
- package/dist/packages/numberkeyboard/numberkeyboard.js.map +1 -1
- package/dist/packages/picker/picker.css +1 -1
- package/dist/packages/picker/picker.js +2 -2
- package/dist/packages/picker/picker.js.map +1 -1
- package/dist/packages/popup/popup.css +1 -1
- package/dist/packages/popup/popup.js +2 -2
- package/dist/packages/popup/popup.js.map +1 -1
- package/dist/packages/price/price.css +1 -1
- package/dist/packages/price/price.js +2 -2
- package/dist/packages/price/price.js.map +1 -1
- package/dist/packages/progress/progress.css +1 -1
- package/dist/packages/progress/progress.js +2 -2
- package/dist/packages/progress/progress.js.map +1 -1
- package/dist/packages/radio/radio.css +1 -1
- package/dist/packages/radio/radio.js +2 -2
- package/dist/packages/radio/radio.js.map +1 -1
- package/dist/packages/radiogroup/radiogroup.css +1 -1
- package/dist/packages/radiogroup/radiogroup.js +2 -2
- package/dist/packages/radiogroup/radiogroup.js.map +1 -1
- package/dist/packages/range/range.css +1 -1
- package/dist/packages/range/range.js +2 -2
- package/dist/packages/range/range.js.map +1 -1
- package/dist/packages/rate/rate.css +1 -1
- package/dist/packages/rate/rate.js +2 -2
- package/dist/packages/rate/rate.js.map +1 -1
- package/dist/packages/row/row.css +1 -1
- package/dist/packages/row/row.js +2 -2
- package/dist/packages/row/row.js.map +1 -1
- package/dist/packages/scroller/scroller.css +1 -1
- package/dist/packages/scroller/scroller.js +2 -2
- package/dist/packages/scroller/scroller.js.map +1 -1
- package/dist/packages/searchbar/searchbar.css +1 -1
- package/dist/packages/searchbar/searchbar.js +2 -2
- package/dist/packages/searchbar/searchbar.js.map +1 -1
- package/dist/packages/shortpassword/shortpassword.css +1 -1
- package/dist/packages/shortpassword/shortpassword.js +2 -2
- package/dist/packages/shortpassword/shortpassword.js.map +1 -1
- package/dist/packages/sidenavbar/sidenavbar.css +1 -1
- package/dist/packages/sidenavbar/sidenavbar.js +2 -2
- package/dist/packages/sidenavbar/sidenavbar.js.map +1 -1
- package/dist/packages/sidenavbaritem/sidenavbaritem.css +1 -1
- package/dist/packages/sidenavbaritem/sidenavbaritem.js +2 -2
- package/dist/packages/sidenavbaritem/sidenavbaritem.js.map +1 -1
- package/dist/packages/signature/signature.css +1 -1
- package/dist/packages/signature/signature.js +2 -2
- package/dist/packages/signature/signature.js.map +1 -1
- package/dist/packages/skeleton/skeleton.css +1 -1
- package/dist/packages/skeleton/skeleton.js +2 -2
- package/dist/packages/skeleton/skeleton.js.map +1 -1
- package/dist/packages/slider/slider.css +1 -1
- package/dist/packages/slider/slider.js +2 -2
- package/dist/packages/slider/slider.js.map +1 -1
- package/dist/packages/stepper/stepper.css +1 -1
- package/dist/packages/stepper/stepper.js +2 -2
- package/dist/packages/stepper/stepper.js.map +1 -1
- package/dist/packages/steps/steps.css +1 -1
- package/dist/packages/steps/steps.js +2 -2
- package/dist/packages/steps/steps.js.map +1 -1
- package/dist/packages/subsidenavbar/subsidenavbar.css +1 -1
- package/dist/packages/subsidenavbar/subsidenavbar.js +2 -2
- package/dist/packages/subsidenavbar/subsidenavbar.js.map +1 -1
- package/dist/packages/swiper/swiper.css +1 -1
- package/dist/packages/swiper/swiper.js +2 -2
- package/dist/packages/swiper/swiper.js.map +1 -1
- package/dist/packages/switch/switch.css +1 -1
- package/dist/packages/switch/switch.js +2 -2
- package/dist/packages/switch/switch.js.map +1 -1
- package/dist/packages/tab/tab.css +1 -1
- package/dist/packages/tab/tab.js +2 -2
- package/dist/packages/tab/tab.js.map +1 -1
- package/dist/packages/tabbar/tabbar.css +1 -1
- package/dist/packages/tabbar/tabbar.js +2 -2
- package/dist/packages/tabbar/tabbar.js.map +1 -1
- package/dist/packages/tabpanel/tabpanel.css +1 -1
- package/dist/packages/tabpanel/tabpanel.js +2 -2
- package/dist/packages/tabpanel/tabpanel.js.map +1 -1
- package/dist/packages/tabselect/tabselect.css +1 -1
- package/dist/packages/tabselect/tabselect.js +2 -2
- package/dist/packages/tabselect/tabselect.js.map +1 -1
- package/dist/packages/textbox/textbox.css +1 -1
- package/dist/packages/textbox/textbox.js +2 -2
- package/dist/packages/textbox/textbox.js.map +1 -1
- package/dist/packages/textinput/textinput.css +1 -1
- package/dist/packages/textinput/textinput.js +2 -2
- package/dist/packages/textinput/textinput.js.map +1 -1
- package/dist/packages/timeline/timeline.css +1 -1
- package/dist/packages/timeline/timeline.js +2 -2
- package/dist/packages/timeline/timeline.js.map +1 -1
- package/dist/packages/timelineitem/timelineitem.css +1 -1
- package/dist/packages/timelineitem/timelineitem.js +2 -2
- package/dist/packages/timelineitem/timelineitem.js.map +1 -1
- package/dist/packages/toast/toast.css +1 -1
- package/dist/packages/toast/toast.js +2 -2
- package/dist/packages/toast/toast.js.map +1 -1
- package/dist/packages/uploader/uploader.css +1 -1
- package/dist/packages/uploader/uploader.js +2 -2
- package/dist/packages/uploader/uploader.js.map +1 -1
- package/dist/packages/video/video.css +1 -1
- package/dist/packages/video/video.js +2 -2
- package/dist/packages/video/video.js.map +1 -1
- package/package.json +5 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.14 - collapseitem.js, ea1cfeedc4af744045aa, Thu Jul 27 2023 18:33:12 GMT+0800 (GMT+08:00)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("collapseitem",[],t):"object"==typeof exports?exports.collapseitem=t():e.collapseitem=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(
|
|
6
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("collapseitem",[],t):"object"==typeof exports?exports.collapseitem=t():e.collapseitem=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./",n(n.s=213)}({0:function(e,t,n){"use strict";function i(e,t,n,i,o,a,r,s){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),r?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):o&&(l=s?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var p=c.render;c.render=function(e,t){return l.call(t),p(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return i}))},155:function(e,t,n){},213:function(e,t,n){"use strict";n.r(t);var i={name:"nut-collapse-item",props:{title:{type:String,default:""},subTitle:{type:String,default:""},disabled:{type:Boolean,default:!1},name:{type:Number|String,default:-1,required:!0}},mounted:function(){var e=this;this.$nextTick((function(){var t=e.$parent&&e.$parent.value;("number"!=typeof t&&"string"!=typeof t||e.name==t&&e.defaultOpen(),t instanceof Array)&&(t.filter((function(t){return t==e.name})).length>0&&e.defaultOpen())})),this.classDirection=this.$parent.expandIconPosition,this.$parent.icon&&this.$set(this.iconStyle,"background-image","url("+this.$parent.icon+")")},data:function(){return{openExpanded:!1,classDirection:"right",iconStyle:{"background-image":"url(https://img10.360buyimg.com/imagetools/jfs/t1/111306/10/17422/341/5f58aa0eEe9218dd6/28d76a42db334e31.png)","background-repeat":"no-repeat","background-size":"100% 100%",transform:"rotate(0deg)"}}},methods:{defaultOpen:function(){this.$parent.accordion?this.$parent.accordionFun(this.name):this.open(),this.$parent.icon&&this.$set(this.iconStyle,"transform","rotate("+this.$parent.rotate+"deg)")},toggleOpen:function(){this.$parent.accordion?(this.$parent.value==this.name&&this.$parent.accordionFun(this.name),this.animation(),this.$parent.changeVal(this.name)):(this.$parent.changeValAry(this.name),this.open())},open:function(){this.openExpanded=!this.openExpanded,this.animation()},animation:function(){var e=this;this.$nextTick((function(){var t=e.$refs,n=t.content,i=t.wrapper;if(n&&i){var o=n.offsetHeight;if(o){var a="".concat(o,"px");i.style.willChange="height",e.openExpanded?i.style.height=a:(i.style.height=a,requestAnimationFrame((function(){requestAnimationFrame((function(){i.style.height=0}))}))),e.$parent.icon&&!e.openExpanded?e.$set(e.iconStyle,"transform","rotate(0deg)"):e.$set(e.iconStyle,"transform","rotate("+e.$parent.rotate+"deg)")}e.openExpanded||e.onTransitionEnd()}}))},changeOpen:function(e){this.openExpanded=e},onTransitionEnd:function(){this.openExpanded&&(this.$refs.wrapper.style.height="auto"),this.$refs.wrapper.style.willChange="auto"}}},o=n(0),a=Object(o.a)(i,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:["nut-collapse-item",{"nut-collapse-item-left":"left"==e.classDirection},{"nut-collapse-item-icon":this.$parent.icon}]},[n("div",{class:["collapse-item",{"item-expanded":e.openExpanded},{"nut-collapse-item-disabled":e.disabled}],on:{click:e.toggleOpen}},[n("div",{staticClass:"collapse-title"},[n("span",{domProps:{innerHTML:e._s(e.title)}})]),e._v(" "),e.subTitle?n("span",{staticClass:"subTitle",domProps:{innerHTML:e._s(e.subTitle)}}):e._e(),e._v(" "),this.$parent.icon?n("i",{class:["collapse-icon",{"col-expanded":e.openExpanded},{"collapse-icon-disabled":e.disabled}],style:e.iconStyle}):n("i",{class:["collapse-icon",{"col-expanded":e.openExpanded},{"collapse-icon-disabled":e.disabled}]})]),e._v(" "),n("div",{ref:"wrapper",class:["collapse-wrapper"],on:{transitionend:e.onTransitionEnd}},[n("div",{ref:"content",staticClass:"collapse-content"},[e._t("default")],2)])])}),[],!1,null,null,null).exports;n(155);a.install=function(e){e.component(a.name,a)};t.default=a}})}));
|
|
7
7
|
//# sourceMappingURL=collapseitem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/./src/packages/collapseitem/collapseitem.vue?8722","webpack://[name]/./src/packages/collapseitem/collapseitem.vue?a765","webpack://[name]/src/packages/collapseitem/collapseitem.vue","webpack://[name]/./src/packages/collapseitem/collapseitem.vue","webpack://[name]/./src/packages/collapseitem/index.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","props","title","type","default","subTitle","disabled","required","mounted","data","openExpanded","classDirection","iconStyle","transform","methods","defaultOpen","toggleOpen","open","animation","content","wrapper","changeOpen","onTransitionEnd","_vm","_c","_self","class","$parent","icon","on","staticClass","domProps","_s","_v","_e","style","ref","_t","CollapseItem","install","Vue","component"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,eAAgB,GAAIH,GACD,iBAAZC,QACdA,QAAsB,aAAID,IAE1BD,EAAmB,aAAIC,IARzB,CASoB,oBAATK,KAAuBA,KAAOC,MAAO,WAChD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUR,QAGnC,IAAIC,EAASK,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHV,QAAS,IAUV,OANAW,EAAQH,GAAUI,KAAKX,EAAOD,QAASC,EAAQA,EAAOD,QAASO,GAG/DN,EAAOS,GAAI,EAGJT,EAAOD,QA0Df,OArDAO,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASf,EAASgB,EAAMC,GAC3CV,EAAoBW,EAAElB,EAASgB,IAClCG,OAAOC,eAAepB,EAASgB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAASvB,GACX,oBAAXwB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAepB,EAASwB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAepB,EAAS,aAAc,CAAE0B,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB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M,CAACE,MAAM,CAAC,gBAAiB,CAAE,gBAAiBH,EAAIb,cAAgB,CAAE,6BAA8Ba,EAAIjB,WAAYuB,GAAG,CAAC,MAAQN,EAAIP,aAAa,CAACQ,EAAG,MAAM,CAACM,YAAY,kBAAkB,CAACN,EAAG,OAAO,CAACO,SAAS,CAAC,UAAYR,EAAIS,GAAGT,EAAIrB,YAAYqB,EAAIU,GAAG,KAAMV,EAAY,SAAEC,EAAG,OAAO,CAACM,YAAY,WAAWC,SAAS,CAAC,UAAYR,EAAIS,GAAGT,EAAIlB,aAAakB,EAAIW,KAAKX,EAAIU,GAAG,KAAMnG,KAAK6F,QAAY,KAAEH,EAAG,IAAI,CAACE,MAAM,CAAC,gBAAiB,CAAE,eAAgBH,EAAIb,cAAgB,CAAE,yBAA0Ba,EAAIjB,WAAY6B,MAAOZ,EAAa,YAAIC,EAAG,IAAI,CAACE,MAAM,CAAC,gBAAiB,CAAE,eAAgBH,EAAIb,cAAgB,CAAE,yBAA0Ba,EAAIjB,eAAgBiB,EAAIU,GAAG,KAAKT,EAAG,MAAM,CAACY,IAAI,UAAUV,MAAM,CAAC,qBAAqB,CAACF,EAAG,MAAM,CAACY,IAAI,UAAUN,YAAY,oBAAoB,CAACP,EAAIc,GAAG,YAAY,SAE39B,IGSpB,EACA,KACA,KACA,M,eCXFC,EAAaC,QAAU,SAASC,GAC9BA,EAAIC,UAAUH,EAAa7F,KAAM6F,IAGpBA","file":"collapseitem/collapseitem.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"collapseitem\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"collapseitem\"] = factory();\n\telse\n\t\troot[\"collapseitem\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 211);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{class:['nut-collapse-item', { 'nut-collapse-item-left': _vm.classDirection == 'left' }, { 'nut-collapse-item-icon': this.$parent.icon }]},[_c('div',{class:['collapse-item', { 'item-expanded': _vm.openExpanded }, { 'nut-collapse-item-disabled': _vm.disabled }],on:{\"click\":_vm.toggleOpen}},[_c('div',{staticClass:\"collapse-title\"},[_c('span',{domProps:{\"innerHTML\":_vm._s(_vm.title)}})]),_vm._v(\" \"),(_vm.subTitle)?_c('span',{staticClass:\"subTitle\",domProps:{\"innerHTML\":_vm._s(_vm.subTitle)}}):_vm._e(),_vm._v(\" \"),(this.$parent.icon)?_c('i',{class:['collapse-icon', { 'col-expanded': _vm.openExpanded }, { 'collapse-icon-disabled': _vm.disabled }],style:(_vm.iconStyle)}):_c('i',{class:['collapse-icon', { 'col-expanded': _vm.openExpanded }, { 'collapse-icon-disabled': _vm.disabled }]})]),_vm._v(\" \"),_c('div',{ref:\"wrapper\",class:['collapse-wrapper']},[_c('div',{ref:\"content\",staticClass:\"collapse-content\"},[_vm._t(\"default\")],2)])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./collapseitem.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./collapseitem.vue?vue&type=script&lang=js&\"","<template>\n <div :class=\"['nut-collapse-item', { 'nut-collapse-item-left': classDirection == 'left' }, { 'nut-collapse-item-icon': this.$parent.icon }]\">\n <div :class=\"['collapse-item', { 'item-expanded': openExpanded }, { 'nut-collapse-item-disabled': disabled }]\" @click=\"toggleOpen\">\n <div class=\"collapse-title\">\n <span v-html=\"title\"></span>\n </div>\n <span v-if=\"subTitle\" v-html=\"subTitle\" class=\"subTitle\"></span>\n <i\n v-if=\"this.$parent.icon\"\n :class=\"['collapse-icon', { 'col-expanded': openExpanded }, { 'collapse-icon-disabled': disabled }]\"\n :style=\"iconStyle\"\n ></i>\n <i v-else :class=\"['collapse-icon', { 'col-expanded': openExpanded }, { 'collapse-icon-disabled': disabled }]\"></i>\n </div>\n <div :class=\"['collapse-wrapper']\" ref=\"wrapper\">\n <div class=\"collapse-content\" ref=\"content\">\n <slot></slot>\n </div>\n </div>\n </div>\n</template>\n<script>\nexport default {\n name: 'nut-collapse-item',\n props: {\n title: {\n type: String,\n default: '',\n },\n subTitle: {\n type: String,\n default: '',\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n name: {\n type: Number | String,\n default: -1,\n required: true,\n },\n },\n mounted() {\n this.$nextTick(() => {\n let active = this.$parent && this.$parent.value;\n if (typeof active == 'number' || typeof active == 'string') {\n if (this.name == active) {\n this.defaultOpen();\n }\n }\n if (active instanceof Array) {\n let f = active.filter((item) => item == this.name);\n if (f.length > 0) {\n this.defaultOpen();\n }\n }\n });\n this.classDirection = this.$parent.expandIconPosition;\n if (this.$parent.icon) {\n this.$set(this.iconStyle, 'background-image', 'url(' + this.$parent.icon + ')');\n }\n },\n data() {\n return {\n openExpanded: false,\n classDirection: 'right',\n iconStyle: {\n 'background-image': 'url(https://img10.360buyimg.com/imagetools/jfs/t1/111306/10/17422/341/5f58aa0eEe9218dd6/28d76a42db334e31.png)',\n 'background-repeat': 'no-repeat',\n 'background-size': '100% 100%',\n transform: 'rotate(0deg)',\n },\n };\n },\n methods: {\n defaultOpen() {\n this.$parent.accordion ? this.$parent.accordionFun(this.name) : this.open();\n if (this.$parent.icon) {\n this.$set(this.iconStyle, 'transform', 'rotate(' + this.$parent.rotate + 'deg)');\n }\n },\n toggleOpen() {\n // this.$parent.changeEvt(this.name);\n if (this.$parent.accordion) {\n if (this.$parent.value == this.name) {\n this.$parent.accordionFun(this.name);\n }\n this.animation();\n this.$parent.changeVal(this.name);\n } else {\n this.$parent.changeValAry(this.name);\n this.open();\n }\n },\n open() {\n this.openExpanded = !this.openExpanded;\n this.animation();\n },\n // 手风琴模式\n animation() {\n this.$nextTick(() => {\n const { content, wrapper } = this.$refs;\n if (!content || !wrapper) {\n return;\n }\n const { offsetHeight } = content;\n if (offsetHeight) {\n const contentHeight = `${offsetHeight}px`;\n wrapper.style.willChange = 'height';\n wrapper.style.height = !this.openExpanded ? 0 : contentHeight;\n if (this.$parent.icon && !this.openExpanded) {\n this.$set(this.iconStyle, 'transform', 'rotate(0deg)');\n } else {\n this.$set(this.iconStyle, 'transform', 'rotate(' + this.$parent.rotate + 'deg)');\n }\n }\n if (!this.openExpanded) {\n this.onTransitionEnd();\n }\n });\n },\n // 更改子组件展示\n changeOpen(bol) {\n this.openExpanded = bol;\n },\n // 清除 willChange 减少性能浪费\n onTransitionEnd() {\n this.$refs.wrapper.style.willChange = 'auto';\n },\n },\n};\n</script>\n","import { render, staticRenderFns } from \"./collapseitem.vue?vue&type=template&id=3eee4a8b&\"\nimport script from \"./collapseitem.vue?vue&type=script&lang=js&\"\nexport * from \"./collapseitem.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import CollapseItem from './collapseitem.vue';\nimport './collapseitem.scss';\n\nCollapseItem.install = function(Vue) {\n Vue.component(CollapseItem.name, CollapseItem);\n};\n\nexport default CollapseItem;\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/./src/packages/collapseitem/collapseitem.vue?703b","webpack://[name]/./src/packages/collapseitem/collapseitem.vue?a765","webpack://[name]/src/packages/collapseitem/collapseitem.vue","webpack://[name]/./src/packages/collapseitem/collapseitem.vue","webpack://[name]/./src/packages/collapseitem/index.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","props","title","type","String","default","subTitle","disabled","Boolean","Number","required","mounted","_this","$nextTick","active","$parent","defaultOpen","Array","filter","item","length","classDirection","expandIconPosition","icon","$set","iconStyle","data","openExpanded","transform","methods","accordion","accordionFun","open","rotate","toggleOpen","animation","changeVal","changeValAry","_this2","_this2$$refs","$refs","content","wrapper","offsetHeight","contentHeight","style","willChange","height","requestAnimationFrame","onTransitionEnd","changeOpen","bol","_vm","_h","$createElement","_c","_self","class","on","staticClass","domProps","_s","_v","_e","ref","_t","CollapseItem","install","Vue","component"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,eAAgB,GAAIH,GACD,iBAAZC,QACdA,QAAsB,aAAID,I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AAKX,EAAIU,GAAG,KAAMhI,KAAKiF,QAAY,KAAEwC,EAAG,IAAI,CAACE,MAAM,CAAC,gBAAiB,CAAE,eAAgBL,EAAIzB,cAAgB,CAAE,yBAA0ByB,EAAI7C,WAAYsC,MAAOO,EAAa,YAAIG,EAAG,IAAI,CAACE,MAAM,CAAC,gBAAiB,CAAE,eAAgBL,EAAIzB,cAAgB,CAAE,yBAA0ByB,EAAI7C,eAAgB6C,EAAIU,GAAG,KAAKP,EAAG,MAAM,CAACS,IAAI,UAAUP,MAAM,CAAC,oBAAoBC,GAAG,CAAC,cAAgBN,EAAIH,kBAAkB,CAACM,EAAG,MAAM,CAACS,IAAI,UAAUL,YAAY,oBAAoB,CAACP,EAAIa,GAAG,YAAY,SACjiC,IGUpB,EACA,KACA,KACA,M,eCXFC,EAAaC,QAAU,SAASC,GAC9BA,EAAIC,UAAUH,EAAazH,KAAMyH,IAGpBA","file":"collapseitem/collapseitem.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"collapseitem\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"collapseitem\"] = factory();\n\telse\n\t\troot[\"collapseitem\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 213);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:['nut-collapse-item', { 'nut-collapse-item-left': _vm.classDirection == 'left' }, { 'nut-collapse-item-icon': this.$parent.icon }]},[_c('div',{class:['collapse-item', { 'item-expanded': _vm.openExpanded }, { 'nut-collapse-item-disabled': _vm.disabled }],on:{\"click\":_vm.toggleOpen}},[_c('div',{staticClass:\"collapse-title\"},[_c('span',{domProps:{\"innerHTML\":_vm._s(_vm.title)}})]),_vm._v(\" \"),(_vm.subTitle)?_c('span',{staticClass:\"subTitle\",domProps:{\"innerHTML\":_vm._s(_vm.subTitle)}}):_vm._e(),_vm._v(\" \"),(this.$parent.icon)?_c('i',{class:['collapse-icon', { 'col-expanded': _vm.openExpanded }, { 'collapse-icon-disabled': _vm.disabled }],style:(_vm.iconStyle)}):_c('i',{class:['collapse-icon', { 'col-expanded': _vm.openExpanded }, { 'collapse-icon-disabled': _vm.disabled }]})]),_vm._v(\" \"),_c('div',{ref:\"wrapper\",class:['collapse-wrapper'],on:{\"transitionend\":_vm.onTransitionEnd}},[_c('div',{ref:\"content\",staticClass:\"collapse-content\"},[_vm._t(\"default\")],2)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./collapseitem.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./collapseitem.vue?vue&type=script&lang=js&\"","<template>\n <div :class=\"['nut-collapse-item', { 'nut-collapse-item-left': classDirection == 'left' }, { 'nut-collapse-item-icon': this.$parent.icon }]\">\n <div :class=\"['collapse-item', { 'item-expanded': openExpanded }, { 'nut-collapse-item-disabled': disabled }]\" @click=\"toggleOpen\">\n <div class=\"collapse-title\">\n <span v-html=\"title\"></span>\n </div>\n <span v-if=\"subTitle\" v-html=\"subTitle\" class=\"subTitle\"></span>\n <i\n v-if=\"this.$parent.icon\"\n :class=\"['collapse-icon', { 'col-expanded': openExpanded }, { 'collapse-icon-disabled': disabled }]\"\n :style=\"iconStyle\"\n ></i>\n <i v-else :class=\"['collapse-icon', { 'col-expanded': openExpanded }, { 'collapse-icon-disabled': disabled }]\"></i>\n </div>\n <div :class=\"['collapse-wrapper']\" ref=\"wrapper\" @transitionend=\"onTransitionEnd\">\n <div class=\"collapse-content\" ref=\"content\">\n <slot></slot>\n </div>\n </div>\n </div>\n</template>\n<script>\nexport default {\n name: 'nut-collapse-item',\n props: {\n title: {\n type: String,\n default: '',\n },\n subTitle: {\n type: String,\n default: '',\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n name: {\n type: Number | String,\n default: -1,\n required: true,\n },\n },\n mounted() {\n this.$nextTick(() => {\n let active = this.$parent && this.$parent.value;\n if (typeof active == 'number' || typeof active == 'string') {\n if (this.name == active) {\n this.defaultOpen();\n }\n }\n if (active instanceof Array) {\n let f = active.filter((item) => item == this.name);\n if (f.length > 0) {\n this.defaultOpen();\n }\n }\n });\n this.classDirection = this.$parent.expandIconPosition;\n if (this.$parent.icon) {\n this.$set(this.iconStyle, 'background-image', 'url(' + this.$parent.icon + ')');\n }\n },\n data() {\n return {\n openExpanded: false,\n classDirection: 'right',\n iconStyle: {\n 'background-image': 'url(https://img10.360buyimg.com/imagetools/jfs/t1/111306/10/17422/341/5f58aa0eEe9218dd6/28d76a42db334e31.png)',\n 'background-repeat': 'no-repeat',\n 'background-size': '100% 100%',\n transform: 'rotate(0deg)',\n },\n };\n },\n methods: {\n defaultOpen() {\n this.$parent.accordion ? this.$parent.accordionFun(this.name) : this.open();\n if (this.$parent.icon) {\n this.$set(this.iconStyle, 'transform', 'rotate(' + this.$parent.rotate + 'deg)');\n }\n },\n toggleOpen() {\n // this.$parent.changeEvt(this.name);\n if (this.$parent.accordion) {\n if (this.$parent.value == this.name) {\n this.$parent.accordionFun(this.name);\n }\n this.animation();\n this.$parent.changeVal(this.name);\n } else {\n this.$parent.changeValAry(this.name);\n this.open();\n }\n },\n open() {\n this.openExpanded = !this.openExpanded;\n this.animation();\n },\n // 手风琴模式\n animation() {\n this.$nextTick(() => {\n const { content, wrapper } = this.$refs;\n if (!content || !wrapper) {\n return;\n }\n const { offsetHeight } = content;\n if (offsetHeight) {\n const contentHeight = `${offsetHeight}px`;\n wrapper.style.willChange = 'height';\n if(!this.openExpanded) {\n wrapper.style.height = contentHeight;\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n wrapper.style.height = 0;\n })\n })\n } else {\n wrapper.style.height = contentHeight;\n }\n if (this.$parent.icon && !this.openExpanded) {\n this.$set(this.iconStyle, 'transform', 'rotate(0deg)');\n } else {\n this.$set(this.iconStyle, 'transform', 'rotate(' + this.$parent.rotate + 'deg)');\n }\n }\n if (!this.openExpanded) {\n this.onTransitionEnd();\n }\n });\n },\n // 更改子组件展示\n changeOpen(bol) {\n this.openExpanded = bol;\n },\n // 清除 willChange 减少性能浪费\n onTransitionEnd() {\n if (this.openExpanded) {\n this.$refs.wrapper.style.height = 'auto';\n }\n this.$refs.wrapper.style.willChange = 'auto';\n },\n },\n};\n</script>\n","import { render, staticRenderFns } from \"./collapseitem.vue?vue&type=template&id=db6f3b10&\"\nimport script from \"./collapseitem.vue?vue&type=script&lang=js&\"\nexport * from \"./collapseitem.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import CollapseItem from './collapseitem.vue';\nimport './collapseitem.scss';\n\nCollapseItem.install = function(Vue) {\n Vue.component(CollapseItem.name, CollapseItem);\n};\n\nexport default CollapseItem;\n"],"sourceRoot":""}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
></i>
|
|
13
13
|
<i v-else :class="['collapse-icon', { 'col-expanded': openExpanded }, { 'collapse-icon-disabled': disabled }]"></i>
|
|
14
14
|
</div>
|
|
15
|
-
<div :class="['collapse-wrapper']" ref="wrapper">
|
|
15
|
+
<div :class="['collapse-wrapper']" ref="wrapper" @transitionend="onTransitionEnd">
|
|
16
16
|
<div class="collapse-content" ref="content">
|
|
17
17
|
<slot></slot>
|
|
18
18
|
</div>
|
|
@@ -108,7 +108,16 @@ export default {
|
|
|
108
108
|
if (offsetHeight) {
|
|
109
109
|
const contentHeight = `${offsetHeight}px`;
|
|
110
110
|
wrapper.style.willChange = 'height';
|
|
111
|
-
|
|
111
|
+
if(!this.openExpanded) {
|
|
112
|
+
wrapper.style.height = contentHeight;
|
|
113
|
+
requestAnimationFrame(() => {
|
|
114
|
+
requestAnimationFrame(() => {
|
|
115
|
+
wrapper.style.height = 0;
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
} else {
|
|
119
|
+
wrapper.style.height = contentHeight;
|
|
120
|
+
}
|
|
112
121
|
if (this.$parent.icon && !this.openExpanded) {
|
|
113
122
|
this.$set(this.iconStyle, 'transform', 'rotate(0deg)');
|
|
114
123
|
} else {
|
|
@@ -126,6 +135,9 @@ export default {
|
|
|
126
135
|
},
|
|
127
136
|
// 清除 willChange 减少性能浪费
|
|
128
137
|
onTransitionEnd() {
|
|
138
|
+
if (this.openExpanded) {
|
|
139
|
+
this.$refs.wrapper.style.height = 'auto';
|
|
140
|
+
}
|
|
129
141
|
this.$refs.wrapper.style.willChange = 'auto';
|
|
130
142
|
},
|
|
131
143
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.14 - countdown.css, ea1cfeedc4af744045aa, Thu Jul 27 2023 18:33:12 GMT+0800 (GMT+08:00)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.14 - countdown.js, ea1cfeedc4af744045aa, Thu Jul 27 2023 18:33:12 GMT+0800 (GMT+08:00)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("countdown",[],e):"object"==typeof exports?exports.countdown=e():t.countdown=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("countdown",[],e):"object"==typeof exports?exports.countdown=e():t.countdown=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=192)}({0:function(t,e,n){"use strict";function i(t,e,n,i,r,s,o,a){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),o?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=u):r&&(u=a?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),u)if(c.functional){c._injectStyles=u;var d=c.render;c.render=function(t,e){return u.call(e),d(t,e)}}else{var l=c.beforeCreate;c.beforeCreate=l?[].concat(l,u):[u]}return{exports:t,options:c}}n.d(e,"a",(function(){return i}))},123:function(t,e,n){},192:function(t,e,n){"use strict";n.r(e);function i(t){for(t+="";t.length<2;)t="0"+t;return t}function r(t){var e=t,n={d:"-",h:"--",m:"--",s:"--"};if(0===e&&(n={d:"0",h:"00",m:"00",s:"00"}),e){var r=864e5,s=36e5,o=e>=r?parseInt(e/r):0,a=e-o*r>=s?parseInt((e-o*r)/s):0,u=e-o*r-a*s>=6e4?parseInt((e-o*r-a*s)/6e4):0,c=Math.round((e-o*r-a*s-6e4*u)/1e3);o>=0&&(n.d=o+""),a>=0&&(n.h=i(a)),u>=0&&(n.m=i(u)),c>=0&&(n.s=i(c))}return n}var s={name:"nut-countdown",data:function(){return{restTime:0,p:0,_curr:0}},props:{value:{type:Object,default:function(){return{}}},paused:{default:!1,type:Boolean},showDays:{default:!1,type:Boolean},showPlainText:{default:!1,type:Boolean},startTime:{type:[Number,String],validator:function(t){return"invalid date"!==new Date(t).toString().toLowerCase()}},endTime:{type:[Number,String],validator:function(t){return"invalid date"!==new Date(t).toString().toLowerCase()}}},computed:{resttime:function(){var t=r(this.restTime),e=t.d;t.h,t.m,t.s;return!this.showDays&&e>0&&(t.h=i(Number(t.h)+24*e),t.d=0),t},plainText:function(){var t=this.resttime,e=t.d,n=t.h,i=t.m,r=t.s;return"".concat(e>0&&this.showDays?e+"天"+n:n,"小时").concat(i,"分").concat(r,"秒")}},watch:{value:function(t,e){},restTime:function(t,e){var n=r(t);this.$emit("input",n)},paused:function(t,e){e?(this.p+=this.getTimeStamp()-this._curr,this.$emit("on-restart",this.restTime)):(this._curr=this.getTimeStamp(),this.$emit("on-paused",this.restTime))},endTime:function(){this.initTimer()},startTime:function(){this.initTimer()}},methods:{getTimeStamp:function(t){if(!t)return Date.now();var e=t;return e=e>0?+e:e.toString().replace(/\-/g,"/"),new Date(e).getTime()},initTimer:function(){var t=this,e=Date.now(),n=this.getTimeStamp(this.startTime||e),i=this.getTimeStamp(this.endTime||e),r=e-n;this.restTime=i-(n+r),this.timer=setInterval((function(){if(!t.paused){var e=i-(Date.now()-t.p+r);t.restTime=e,e<1e3&&(t.restTime=0,t.$emit("on-end"),clearInterval(t.timer))}}),1e3)}},created:function(){this.initTimer()},destroyed:function(){this.timer&&clearInterval(this.timer)}};s.restTime=r;var o=s,a=n(0),u=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"nut-cd-timer"},[t.$slots.default?[t._t("default")]:t.showPlainText?[n("span",{staticClass:"nut-cd-block"},[t._v(t._s(t.plainText))])]:[t.resttime.d>=0&&t.showDays?[n("span",{staticClass:"nut-cd-block"},[t._v(t._s(t.resttime.d))]),t._v(" "),n("span",{staticClass:"nut-cd-dot"},[t._v("天")])]:t._e(),t._v(" "),n("span",{staticClass:"nut-cd-block"},[t._v(t._s(t.resttime.h))]),n("span",{staticClass:"nut-cd-dot"},[t._v(":")]),n("span",{staticClass:"nut-cd-block"},[t._v(t._s(t.resttime.m))]),n("span",{staticClass:"nut-cd-dot"},[t._v(":")]),n("span",{staticClass:"nut-cd-block"},[t._v(t._s(t.resttime.s))])]],2)}),[],!1,null,null,null).exports;n(123);u.install=function(t){t.component(u.name,u)};e.default=u}})}));
|
|
7
7
|
//# sourceMappingURL=countdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/src/packages/countdown/countdown.vue","webpack://[name]/./src/packages/countdown/countdown.vue?ae46","webpack://[name]/./src/packages/countdown/countdown.vue","webpack://[name]/./src/packages/countdown/countdown.vue?afc8","webpack://[name]/./src/packages/countdown/index.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","fill2","v","rest","data","restTime","_curr","props","type","default","paused","showDays","showPlainText","startTime","validator","endTime","computed","resttime","plainText","watch","methods","getTimeStamp","initTimer","clearInterval","created","destroyed","countdownTimer","_vm","_c","_self","_setupProxy","staticClass","$slots","_t","_v","_s","_e","CountDown","install","Vue","component"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,YAAa,GAAIH,GACE,iBAAZC,QACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,IARtB,CASoB,oBAATK,KAAuBA,KAAOC,MAAO,WAChD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUR,QAGnC,IAAIC,EAASK,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHV,QAAS,IAUV,OANAW,EAAQH,GAAUI,KAAKX,EAAOD,QAASC,EAAQA,EAAOD,QAASO,GAG/DN,EAAOS,GAAI,EAGJT,EAAOD,QA0Df,OArDAO,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASf,EAASgB,EAAMC,GAC3CV,EAAoBW,EAAElB,EAASgB,IAClCG,OAAOC,eAAepB,EAASgB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAASvB,GACX,oBAAXwB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAepB,EAASwB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAepB,EAAS,aAAc,CAAE0B,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,O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AC,mBACA,kBAEAC,qBACA,wCAGAC,EAAeA,SAAWA,EAIX,ICxL+N,EDwL/N,E,OEtKA,EAXC,YACd,GCRW,WAAkB,IAAIC,EAAI7F,KAAK8F,EAAGD,EAAIE,MAAMD,GAAUD,EAAIE,MAAMC,YAAY,OAAOF,EAAG,OAAO,CAACG,YAAY,gBAAgB,CAAEJ,EAAIK,OAAc,QAAE,CAACL,EAAIM,GAAG,YAAaN,EAAiB,cAAE,CAACC,EAAG,OAAO,CAACG,YAAY,gBAAgB,CAACJ,EAAIO,GAAGP,EAAIQ,GAAGR,EAAIT,eAAe,CAAES,EAAIV,SAASzE,GAAK,GAAKmF,EAAIhB,SAAU,CAACiB,EAAG,OAAO,CAACG,YAAY,gBAAgB,CAACJ,EAAIO,GAAGP,EAAIQ,GAAGR,EAAIV,SAASzE,MAAMmF,EAAIO,GAAG,KAAKN,EAAG,OAAO,CAACG,YAAY,cAAc,CAACJ,EAAIO,GAAG,QAAQP,EAAIS,KAAKT,EAAIO,GAAG,KAAKN,EAAG,OAAO,CAACG,YAAY,gBAAgB,CAACJ,EAAIO,GAAGP,EAAIQ,GAAGR,EAAIV,SAASpB,MAAM+B,EAAG,OAAO,CAACG,YAAY,cAAc,CAACJ,EAAIO,GAAG,OAAON,EAAG,OAAO,CAACG,YAAY,gBAAgB,CAACJ,EAAIO,GAAGP,EAAIQ,GAAGR,EAAIV,SAAS3E,MAAMsF,EAAG,OAAO,CAACG,YAAY,cAAc,CAACJ,EAAIO,GAAG,OAAON,EAAG,OAAO,CAACG,YAAY,gBAAgB,CAACJ,EAAIO,GAAGP,EAAIQ,GAAGR,EAAIV,SAAShD,QAAQ,KAErwB,IDSpB,EACA,KACA,KACA,M,eEXFoE,EAAUC,QAAU,SAASC,GAC3BA,EAAIC,UAAUH,EAAU5F,KAAM4F,IAGjBA","file":"countdown/countdown.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"countdown\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"countdown\"] = factory();\n\telse\n\t\troot[\"countdown\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 190);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","<template>\n <span class=\"nut-cd-timer\">\n <template v-if=\"$slots.default\">\n <slot></slot>\n </template>\n <template v-else-if=\"showPlainText\">\n <span class=\"nut-cd-block\">{{ plainText }}</span>\n </template>\n <template v-else>\n <template v-if=\"resttime.d >= 0 && showDays\">\n <span class=\"nut-cd-block\">{{ resttime.d }}</span>\n <span class=\"nut-cd-dot\">天</span>\n </template>\n <span class=\"nut-cd-block\">{{ resttime.h }}</span\n ><span class=\"nut-cd-dot\">:</span><span class=\"nut-cd-block\">{{ resttime.m }}</span\n ><span class=\"nut-cd-dot\">:</span><span class=\"nut-cd-block\">{{ resttime.s }}</span>\n </template>\n </span>\n</template>\n<script>\nfunction fill2(v) {\n v += '';\n while (v.length < 2) {\n v = '0' + v;\n }\n return v;\n}\nfunction restTime(t) {\n const ts = t;\n let rest = {\n d: '-',\n h: '--',\n m: '--',\n s: '--'\n };\n if (ts === 0) {\n rest = {\n d: '0',\n h: '00',\n m: '00',\n s: '00'\n };\n }\n if (ts) {\n const ds = 24 * 60 * 60 * 1000;\n const hs = 60 * 60 * 1000;\n const ms = 60 * 1000;\n\n const d = ts >= ds ? parseInt(ts / ds) : 0;\n const h = ts - d * ds >= hs ? parseInt((ts - d * ds) / hs) : 0;\n const m = ts - d * ds - h * hs >= ms ? parseInt((ts - d * ds - h * hs) / ms) : 0;\n const s = Math.round((ts - d * ds - h * hs - m * ms) / 1000);\n\n if (d >= 0) rest.d = d + '';\n if (h >= 0) rest.h = fill2(h);\n if (m >= 0) rest.m = fill2(m);\n if (s >= 0) rest.s = fill2(s);\n }\n return rest;\n}\n\nconst countdownTimer = {\n name: 'nut-countdown',\n data() {\n return {\n restTime: 0,\n p: 0,\n _curr: 0\n };\n },\n props: {\n value: {\n type: Object,\n default: () => {\n return {};\n }\n },\n paused: {\n default: false,\n type: Boolean\n },\n showDays: {\n default: false,\n type: Boolean\n },\n showPlainText: {\n default: false,\n type: Boolean\n },\n startTime: {\n // 可以是服务器当前时间\n type: [Number, String],\n validator(v) {\n const dateStr = new Date(v).toString().toLowerCase();\n return dateStr !== 'invalid date';\n }\n },\n endTime: {\n type: [Number, String],\n validator(v) {\n const dateStr = new Date(v).toString().toLowerCase();\n return dateStr !== 'invalid date';\n }\n }\n },\n computed: {\n resttime() {\n const rest = restTime(this.restTime);\n const { d, h, m, s } = rest;\n if (!this.showDays && d > 0) {\n rest.h = fill2(Number(rest.h) + d * 24);\n rest.d = 0;\n }\n return rest;\n },\n plainText() {\n const { d, h, m, s } = this.resttime;\n\n return `${d > 0 && this.showDays ? d + '天' + h : h}小时${m}分${s}秒`;\n }\n },\n watch: {\n value(newVal, oldVal) {},\n restTime(n, o) {\n let tranTime = restTime(n);\n this.$emit('input', tranTime);\n },\n paused(v, ov) {\n if (!ov) {\n this._curr = this.getTimeStamp();\n this.$emit('on-paused', this.restTime);\n } else {\n this.p += this.getTimeStamp() - this._curr;\n this.$emit('on-restart', this.restTime);\n }\n },\n endTime() {\n this.initTimer();\n },\n startTime() {\n this.initTimer();\n }\n },\n methods: {\n getTimeStamp(timeStr) {\n if (!timeStr) return Date.now();\n let t = timeStr;\n t = t > 0 ? +t : t.toString().replace(/\\-/g, '/');\n return new Date(t).getTime();\n },\n initTimer() {\n const delay = 1000;\n const curr = Date.now();\n const start = this.getTimeStamp(this.startTime || curr);\n const end = this.getTimeStamp(this.endTime || curr);\n const diffTime = curr - start;\n\n this.restTime = end - (start + diffTime);\n this.timer = setInterval(() => {\n if (!this.paused) {\n let restTime = end - (Date.now() - this.p + diffTime);\n this.restTime = restTime;\n if (restTime < delay) {\n this.restTime = 0;\n this.$emit('on-end');\n clearInterval(this.timer);\n }\n } else {\n // 暂停\n }\n }, delay);\n }\n },\n created() {\n this.initTimer();\n },\n destroyed() {\n this.timer && clearInterval(this.timer);\n }\n};\ncountdownTimer.restTime = restTime;\n\n// export fill2 for test\nexport { restTime, fill2 };\nexport default countdownTimer;\n</script>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./countdown.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./countdown.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./countdown.vue?vue&type=template&id=5863995e&\"\nimport script from \"./countdown.vue?vue&type=script&lang=js&\"\nexport * from \"./countdown.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('span',{staticClass:\"nut-cd-timer\"},[(_vm.$slots.default)?[_vm._t(\"default\")]:(_vm.showPlainText)?[_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.plainText))])]:[(_vm.resttime.d >= 0 && _vm.showDays)?[_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.resttime.d))]),_vm._v(\" \"),_c('span',{staticClass:\"nut-cd-dot\"},[_vm._v(\"天\")])]:_vm._e(),_vm._v(\" \"),_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.resttime.h))]),_c('span',{staticClass:\"nut-cd-dot\"},[_vm._v(\":\")]),_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.resttime.m))]),_c('span',{staticClass:\"nut-cd-dot\"},[_vm._v(\":\")]),_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.resttime.s))])]],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import CountDown from './countdown.vue';\nimport './countdown.scss';\n\nCountDown.install = function(Vue) {\n Vue.component(CountDown.name, CountDown);\n};\n\nexport default CountDown;\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/src/packages/countdown/countdown.vue","webpack://[name]/./src/packages/countdown/countdown.vue?ae46","webpack://[name]/./src/packages/countdown/countdown.vue","webpack://[name]/./src/packages/countdown/countdown.vue?546e","webpack://[name]/./src/packages/countdown/index.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","fill2","v","length","restTime","ts","rest","ds","hs","parseInt","Math","round","countdownTimer","data","_curr","props","type","default","paused","Boolean","showDays","showPlainText","startTime","Number","String","validator","Date","toString","toLowerCase","endTime","computed","resttime","plainText","_this$resttime","watch","newVal","oldVal","tranTime","$emit","ov","getTimeStamp","initTimer","methods","timeStr","now","replace","getTime","_this","curr","start","end","diffTime","timer","setInterval","clearInterval","created","destroyed","_vm","_h","$createElement","_c","_self","staticClass","$slots","_t","_v","_s","_e","CountDown","install","Vue","component"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,YAAa,GAAIH,GACE,iBAAZC,QACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,IARtB,CASoB,oBAATK,KAAuBA,KAAOC,MAAO,WAChD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUR,QAGnC,IAAIC,EAASK,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHV,QAAS,IAUV,OANAW,EAAQH,GAAUI,KAAKX,EAAOD,QAASC,EAAQA,EAAOD,QAASO,GAG/DN,EAAOS,GAAI,EAGJT,EAAOD,QA0Df,OArDAO,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASf,EAASgB,EAAMC,GAC3CV,EAAoBW,EAAElB,EAASgB,IAClCG,OAAOC,eAAepB,EAASgB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAASvB,GACX,oBAAXwB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAepB,EAASwB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAepB,EAAS,aAAc,CAAE0B,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EA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GAAK,GAAKiH,EAAIrC,SAAU,CAACwC,EAAG,OAAO,CAACE,YAAY,gBAAgB,CAACL,EAAIQ,GAAGR,EAAIS,GAAGT,EAAI1B,SAASvF,MAAMiH,EAAIQ,GAAG,KAAKL,EAAG,OAAO,CAACE,YAAY,cAAc,CAACL,EAAIQ,GAAG,QAAQR,EAAIU,KAAKV,EAAIQ,GAAG,KAAKL,EAAG,OAAO,CAACE,YAAY,gBAAgB,CAACL,EAAIQ,GAAGR,EAAIS,GAAGT,EAAI1B,SAASlC,MAAM+D,EAAG,OAAO,CAACE,YAAY,cAAc,CAACL,EAAIQ,GAAG,OAAOL,EAAG,OAAO,CAACE,YAAY,gBAAgB,CAACL,EAAIQ,GAAGR,EAAIS,GAAGT,EAAI1B,SAASzF,MAAMsH,EAAG,OAAO,CAACE,YAAY,cAAc,CAACL,EAAIQ,GAAG,OAAOL,EAAG,OAAO,CAACE,YAAY,gBAAgB,CAACL,EAAIQ,GAAGR,EAAIS,GAAGT,EAAI1B,SAAS9D,QAAQ,KACrwB,IDUpB,EACA,KACA,KACA,M,eEXFmG,EAAUC,QAAU,SAASC,GAC3BA,EAAIC,UAAUH,EAAU3H,KAAM2H,IAGjBA","file":"countdown/countdown.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"countdown\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"countdown\"] = factory();\n\telse\n\t\troot[\"countdown\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 192);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","<template>\n <span class=\"nut-cd-timer\">\n <template v-if=\"$slots.default\">\n <slot></slot>\n </template>\n <template v-else-if=\"showPlainText\">\n <span class=\"nut-cd-block\">{{ plainText }}</span>\n </template>\n <template v-else>\n <template v-if=\"resttime.d >= 0 && showDays\">\n <span class=\"nut-cd-block\">{{ resttime.d }}</span>\n <span class=\"nut-cd-dot\">天</span>\n </template>\n <span class=\"nut-cd-block\">{{ resttime.h }}</span\n ><span class=\"nut-cd-dot\">:</span><span class=\"nut-cd-block\">{{ resttime.m }}</span\n ><span class=\"nut-cd-dot\">:</span><span class=\"nut-cd-block\">{{ resttime.s }}</span>\n </template>\n </span>\n</template>\n<script>\nfunction fill2(v) {\n v += '';\n while (v.length < 2) {\n v = '0' + v;\n }\n return v;\n}\nfunction restTime(t) {\n const ts = t;\n let rest = {\n d: '-',\n h: '--',\n m: '--',\n s: '--'\n };\n if (ts === 0) {\n rest = {\n d: '0',\n h: '00',\n m: '00',\n s: '00'\n };\n }\n if (ts) {\n const ds = 24 * 60 * 60 * 1000;\n const hs = 60 * 60 * 1000;\n const ms = 60 * 1000;\n\n const d = ts >= ds ? parseInt(ts / ds) : 0;\n const h = ts - d * ds >= hs ? parseInt((ts - d * ds) / hs) : 0;\n const m = ts - d * ds - h * hs >= ms ? parseInt((ts - d * ds - h * hs) / ms) : 0;\n const s = Math.round((ts - d * ds - h * hs - m * ms) / 1000);\n\n if (d >= 0) rest.d = d + '';\n if (h >= 0) rest.h = fill2(h);\n if (m >= 0) rest.m = fill2(m);\n if (s >= 0) rest.s = fill2(s);\n }\n return rest;\n}\n\nconst countdownTimer = {\n name: 'nut-countdown',\n data() {\n return {\n restTime: 0,\n p: 0,\n _curr: 0\n };\n },\n props: {\n value: {\n type: Object,\n default: () => {\n return {};\n }\n },\n paused: {\n default: false,\n type: Boolean\n },\n showDays: {\n default: false,\n type: Boolean\n },\n showPlainText: {\n default: false,\n type: Boolean\n },\n startTime: {\n // 可以是服务器当前时间\n type: [Number, String],\n validator(v) {\n const dateStr = new Date(v).toString().toLowerCase();\n return dateStr !== 'invalid date';\n }\n },\n endTime: {\n type: [Number, String],\n validator(v) {\n const dateStr = new Date(v).toString().toLowerCase();\n return dateStr !== 'invalid date';\n }\n }\n },\n computed: {\n resttime() {\n const rest = restTime(this.restTime);\n const { d, h, m, s } = rest;\n if (!this.showDays && d > 0) {\n rest.h = fill2(Number(rest.h) + d * 24);\n rest.d = 0;\n }\n return rest;\n },\n plainText() {\n const { d, h, m, s } = this.resttime;\n\n return `${d > 0 && this.showDays ? d + '天' + h : h}小时${m}分${s}秒`;\n }\n },\n watch: {\n value(newVal, oldVal) {},\n restTime(n, o) {\n let tranTime = restTime(n);\n this.$emit('input', tranTime);\n },\n paused(v, ov) {\n if (!ov) {\n this._curr = this.getTimeStamp();\n this.$emit('on-paused', this.restTime);\n } else {\n this.p += this.getTimeStamp() - this._curr;\n this.$emit('on-restart', this.restTime);\n }\n },\n endTime() {\n this.initTimer();\n },\n startTime() {\n this.initTimer();\n }\n },\n methods: {\n getTimeStamp(timeStr) {\n if (!timeStr) return Date.now();\n let t = timeStr;\n t = t > 0 ? +t : t.toString().replace(/\\-/g, '/');\n return new Date(t).getTime();\n },\n initTimer() {\n const delay = 1000;\n const curr = Date.now();\n const start = this.getTimeStamp(this.startTime || curr);\n const end = this.getTimeStamp(this.endTime || curr);\n const diffTime = curr - start;\n\n this.restTime = end - (start + diffTime);\n this.timer = setInterval(() => {\n if (!this.paused) {\n let restTime = end - (Date.now() - this.p + diffTime);\n this.restTime = restTime;\n if (restTime < delay) {\n this.restTime = 0;\n this.$emit('on-end');\n clearInterval(this.timer);\n }\n } else {\n // 暂停\n }\n }, delay);\n }\n },\n created() {\n this.initTimer();\n },\n destroyed() {\n this.timer && clearInterval(this.timer);\n }\n};\ncountdownTimer.restTime = restTime;\n\n// export fill2 for test\nexport { restTime, fill2 };\nexport default countdownTimer;\n</script>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./countdown.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./countdown.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./countdown.vue?vue&type=template&id=5863995e&\"\nimport script from \"./countdown.vue?vue&type=script&lang=js&\"\nexport * from \"./countdown.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:\"nut-cd-timer\"},[(_vm.$slots.default)?[_vm._t(\"default\")]:(_vm.showPlainText)?[_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.plainText))])]:[(_vm.resttime.d >= 0 && _vm.showDays)?[_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.resttime.d))]),_vm._v(\" \"),_c('span',{staticClass:\"nut-cd-dot\"},[_vm._v(\"天\")])]:_vm._e(),_vm._v(\" \"),_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.resttime.h))]),_c('span',{staticClass:\"nut-cd-dot\"},[_vm._v(\":\")]),_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.resttime.m))]),_c('span',{staticClass:\"nut-cd-dot\"},[_vm._v(\":\")]),_c('span',{staticClass:\"nut-cd-block\"},[_vm._v(_vm._s(_vm.resttime.s))])]],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import CountDown from './countdown.vue';\nimport './countdown.scss';\n\nCountDown.install = function(Vue) {\n Vue.component(CountDown.name, CountDown);\n};\n\nexport default CountDown;\n"],"sourceRoot":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.14 - countup.css, ea1cfeedc4af744045aa, Thu Jul 27 2023 18:33:12 GMT+0800 (GMT+08:00)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/.nut-countup{display:inline-block;width:100%;padding:5px;color:#000;font-weight:700}.nut-countup .run-number{padding:0;width:100%;overflow:hidden;text-align:center;font-weight:700;position:relative}.nut-countup .run-number li{position:absolute;-webkit-transition:none;-o-transition:none;transition:none;list-style:none}.nut-countup .run-number li span{display:block}.nut-countup .pointstyl{position:absolute;display:block}.nut-countup .run-number-machine-img{overflow:hidden}.nut-countup .run-number-machine-img li{float:left;background-position:center 0;background-repeat:repeat-y;background-attachment:scroll}.nut-countup .run-number-img{position:relative}.nut-countup .run-number-img li{position:absolute;-webkit-transition:none;-o-transition:none;transition:none;display:inline-block;background-position:0 0;background-repeat:no-repeat}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.14 - countup.js, ea1cfeedc4af744045aa, Thu Jul 27 2023 18:33:12 GMT+0800 (GMT+08:00)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("countup",[],e):"object"==typeof exports?exports.countup=e():t.countup=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=207)}({0:function(t,e,n){"use strict";function i(t,e,n,i,r,u,o,l){var a,s="function"==typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=n,s._compiled=!0),i&&(s.functional=!0),u&&(s._scopeId="data-v-"+u),o?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},s._ssrRegister=a):r&&(a=l?function(){r.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:r),a)if(s.functional){s._injectStyles=a;var m=s.render;s.render=function(t,e){return a.call(e),m(t,e)}}else{var c=s.beforeCreate;s.beforeCreate=c?[].concat(c,a):[a]}return{exports:t,options:s}}n.d(e,"a",(function(){return i}))},147:function(t,e,n){},207:function(t,e,n){"use strict";n.r(e);var i={name:"nut-countup",props:{initNum:{type:Number,default:0},endNum:{type:Number,default:0},speed:{type:Number,default:1},toFixed:{type:Number,default:0},during:{type:Number,default:1e3},startFlag:{type:Boolean,default:!0},numWidth:{type:Number,default:20},numHeight:{type:Number,default:20},scrolling:{type:Boolean,default:!1},customBgImg:{type:String,default:""},customSpacNum:{type:Number,default:0},customChangeNum:{type:Number,default:1},type:{type:String,default:""},machineNum:{type:Number,default:3},machinePrizeNum:{type:Number,default:0},machinePrizeLevel:{type:Number,default:0},machineTrunMore:{type:Number,default:0}},data:function(){return{valFlag:!1,current:0,sortFlag:"add",initDigit1:0,initDigit2:0,to0_10:[0,1,2,3,4,5,6,7,8,9,0],to10_0:[0,9,8,7,6,5,4,3,2,1,1],timer:null,totalCount:0,pointNum:0,numberVal:0,num_total_len:0,relNum:0,customNumber:1,prizeLevelTrun:0,prizeY:[],prizeYPrev:[],finshMachine:0,notPrize:[],typeMachine:""}},computed:{},watch:{customChangeNum:function(t,e){this.customNumber=t,this.countGo()},machinePrizeLevel:function(t,e){this.prizeLevelTrun=t},initNum:function(t,e){this.current=t,this.valFlag=!1,this.valChange()},endNum:function(t,e){this.current=this.initNum,this.valFlag=!1,this.valChange()}},mounted:function(){this.current=this.initNum,this.valChange()},beforeDestroy:function(){clearInterval(this.timer),this.timer=null},methods:{valChange:function(){var t=this;if(this.valFlag)return!1;this.startFlag&&(this.scrolling||this.customBgImg?"machine"!=this.type&&this.countGo():(this.countChange(),setTimeout((function(){t.valFlag=!0}),300)))},clearInterval:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){clearInterval(this.timer),this.timer=null})),calculation:function(t,e,n){var i=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,u=Math.pow(10,Math.max(i,r));return"-"==n?(t*u-e*u).toFixed(0)/u:(t*u+e*u).toFixed(0)/u},countChange:function(){var t=this,e=this.endNum,n=this.initNum,i=this.speed,r=this.toFixed,u=setInterval((function(){n>e?t.current<=e||t.current<=i?(t.current=e.toFixed(r),clearInterval(u),t.$emit("scroll-end"),t.valFlag=!1):t.current=(parseFloat(t.current)-parseFloat(i)).toFixed(r):t.current>=e?(t.current=e.toFixed(r),clearInterval(u),t.$emit("scroll-end"),t.valFlag=!1):t.current=(parseFloat(t.current)+parseFloat(i)).toFixed(r)}),this.during)},topNumber:function(t){var e=this.num_total_len,n=this.pointNum,i=this.initDigit1,r=this.initDigit2,u=this.sortFlag,o="add"==u||"equal"==u?r[t-(e-n)]:10-r[t-(e-n)],l="add"==u||"equal"==u?i[t]:10-i[t],a=t>e-n-1?100*-o+"%":t<=i.length-1?100*-l+"%":0;return"-1000%"==a&&(a=0),a},turnNumber:function(t){var e=this.num_total_len,n=this.pointNum,i=this.initDigit1,r=this.initDigit2,u=(this.sortFlag,r[t-(e-n)]);return t>e-n-1?u||0:t<=i.length-1?i[t]:0},countGo:function(){var t,e,n,i,r=this,u=this.initNum,o=this.endNum,l=this.toFixed,a=this.customBgImg;a&&(u=this.customNumber),0!=u?(0!=l&&(u=u.toFixed(l)),String(u).indexOf(".")>-1?(t=String(u).split(".")[0].length,e=String(u).split(".")[1].length):(t=String(u).length,e=0)):(t=1,e=0),0!=o?(0!=l&&(o=o.toFixed(l)),String(o).indexOf(".")>-1?(n=String(o).split(".")[0].length,i=String(o).split(".")[1].length):(n=String(o).length,i=0)):(n=1,i=0);var s=t>=n?t:n,m=e>=i?e:i;this.num_total_len=s+m,this.pointNum=m,u>o?(this.sortFlag="reduce",this.to0_10=[0,9,8,7,6,5,4,3,2,1,0],this.totalCount=this.calculation(u,o,"-"),this.numberVal=String(u)):u<o?(this.sortFlag="add",this.to0_10=[0,1,2,3,4,5,6,7,8,9,0],this.totalCount=this.calculation(o,u,"-"),this.numberVal=String(o)):this.sortFlag="equal";for(var c=1,h=0;h<this.pointNum;h++)c*=10;var p=this.numberVal*c;if(this.relNum=p,0!=l&&(this.pointNum=this.numberVal.split(".")[1]?this.numberVal.split(".")[1].length:0,this.num_total_len=String(p).length),String(u).indexOf(".")>-1){var g=String(u).split(".");this.initDigit1=g[0],this.initDigit2=g[1]}else this.initDigit1=String(u),this.initDigit2="0";this.scrolling&&!a?this.$nextTick((function(){if("equal"==r.sortFlag)return!1;var t=r.$refs.numberItem[r.num_total_len-1];r.runTurn(t)})):this.imgNumberScroll()},runTurn:function(t){var e=this,n=this;n.clearInterval();var i=1;0!=this.pointNum&&(i=1/Math.pow(10,this.pointNum)),n.timer=setInterval((function(){n.runStep(t),n.totalCount=n.calculation(n.totalCount,i,"-"),n.totalCount<=0&&(n.clearInterval(),e.$emit("scroll-end"),e.valFlag=!1)}),n.during)},runStep:function(t){var e=this,n=t.getAttribute("turn-number"),i=null;if(i="add"==e.sortFlag?parseInt(n)+1:parseInt(n)-1>=0?parseInt(n)-1:9,t.setAttribute("turn-number",i),"none 0s ease 0s"!=t.style.transition&&1!=i&&t.style.transition||(t.style.transition="all linear ".concat(e.during,"ms")),10==i||"reduce"==e.sortFlag&&0==i){var r=null;t.style.top="-".concat("add"==e.sortFlag?100*i:100*(10-i),"%"),t.setAttribute("turn-number",0),r=setTimeout((function(){r&&clearTimeout(r),t.style.transition="none",t.style.top=0,10==i&&t.previousSibling&&e.runStep(t.previousSibling)}),.975*e.during)}else t.style.top="-".concat("add"==e.sortFlag?100*i:100*(10-i),"%");"-100%"==t.style.top&&"reduce"==e.sortFlag&&e.runStep(t.previousSibling)},imgNumberScroll:function(){var t=this,e=this,n=1;0!=e.pointNum&&(n=Math.pow(10,e.pointNum)),this.$nextTick((function(){var i=e.$el.querySelector(".run-number-img");setTimeout((function(){e.relNum=e.calculation(e.relNum,n*e.speed,"+")}),e.during),i.addEventListener("webkitTransitionEnd",(function(){t.$emit("scroll-end"),t.valFlag=!1,setTimeout((function(){e.relNum=e.calculation(e.relNum,n*e.speed,"+")}),e.during)}))}))},generateRandom:function(){for(this.notPrize=[];this.notPrize.length<3;){var t=Math.floor(Math.random()*this.machinePrizeNum+1);-1==this.notPrize.indexOf(t)&&this.notPrize.push(t)}},machineLuck:function(){var t=this;this.machineTrunMore=this.machineTrunMore<0?0:this.machineTrunMore;var e=this.numHeight*this.machinePrizeNum;this.prizeLevelTrun<0&&this.generateRandom();for(var n=function(n){setTimeout((function(){var i=e*(n+1+parseFloat(t.machineTrunMore));0!=t.prizeYPrev.length&&t.$set(t.prizeY,n,t.prizeYPrev[n]);var r=t.prizeYPrev[n]?t.prizeYPrev[n]:0,u=i+r+(t.machinePrizeNum-t.prizeLevelTrun+1)*t.numHeight+(e-r);t.prizeLevelTrun<0&&(u+=t.numHeight*t.notPrize[n]),t.scrollTime(n,u,r)}),500*n)},i=0;i<this.machineNum;i++)n(i)},scrollTime:function(t,e,n){var i=this,r=setInterval((function(){if(n<=e)n+=10,i.$set(i.prizeY,t,parseFloat(n));else if(clearInterval(r),r=null,i.finshMachine+=1,i.$set(i.prizeY,t,e),i.finshMachine==i.machineNum){var u=i.numHeight*i.machinePrizeNum;i.prizeYPrev=[],JSON.parse(JSON.stringify(i.prizeY)).forEach((function(t){for(var e=t;e>u;)e-=u;i.prizeYPrev.push(e)})),setTimeout((function(){i.finshMachine=0,i.prizeLevelTrun<0?(i.$emit("scroll-end",!1),i.valFlag=!1):(i.$emit("scroll-end",!0),i.valFlag=!1)}),130)}}),30)}}},r=n(0),u=Object(r.a)(i,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"nut-countup"},[""!=t.customBgImg?["machine"==t.type?[e("ul",{staticClass:"run-number-machine-img",style:{height:t.numHeight+"px"}},t._l(t.machineNum,(function(n,i){return e("li",{key:"mImg"+i,ref:"run-number-machine-img-li",refInFor:!0,staticClass:"run-number-machine-img-li",style:{width:t.numWidth+"px",height:t.numHeight+"px",backgroundImage:"url("+t.customBgImg+")",backgroundPositionY:t.prizeY[i]+"px"}})})),0)]:[e("ul",{staticClass:"run-number-img",style:{height:t.numHeight+"px"}},[t._l(t.num_total_len,(function(n,i){return e("li",{key:"cImg"+i,staticClass:"run-number-img-li",style:{width:t.numWidth+"px",height:t.numHeight+"px",left:t.numWidth*(i>t.num_total_len-t.pointNum-1?i==t.num_total_len-t.pointNum?1.5*i:1.3*i:i)+"px",backgroundImage:"url("+t.customBgImg+")",backgroundPosition:"0 "+-(String(t.relNum)[i]*t.numHeight+t.customSpacNum*String(t.relNum)[i])+"px",transition:"all linear "+t.during/10+"ms"}})})),t._v(" "),t.pointNum>0?e("div",{staticClass:"pointstyl",style:{width:t.numWidth/2+"px",bottom:0,left:t.numWidth*(t.num_total_len-t.pointNum)*1.1+"px",fontSize:"30px"}},[t._v(".")]):t._e()],2)]]:[t.scrolling?e("ul",{staticClass:"run-number",style:{width:t.numWidth*t.num_total_len+t.numWidth/3+"px",height:t.numHeight+"px",lineHeight:t.numHeight+"px"}},[t._l(t.num_total_len,(function(n,i){return e("li",{key:n,ref:"numberItem",refInFor:!0,style:{top:t.topNumber(i),left:t.numWidth*(i>t.num_total_len-t.pointNum-1?1.1*i:i)+"px"},attrs:{"turn-number":t.turnNumber(i)}},t._l(t.to0_10,(function(n,i){return e("span",{key:"dote"+i,style:{width:t.numWidth+"px",height:t.numHeight+"px",lineHeight:t.numHeight+"px"}},[t._v("\n "+t._s(n)+"\n ")])})),0)})),t._v(" "),t.pointNum>0?e("div",{staticClass:"pointstyl",style:{width:t.numWidth/3+"px",height:t.numHeight+"px",lineHeight:t.numHeight+"px",top:0,left:t.numWidth*(t.num_total_len-t.pointNum)+"px"}},[t._v(".")]):t._e()],2):[t._v("\n "+t._s(t.current)+"\n ")]]],2)}),[],!1,null,null,null).exports;n(147);u.install=function(t){t.component(u.name,u)};e.default=u}})}));
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("countup",[],e):"object"==typeof exports?exports.countup=e():t.countup=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=209)}({0:function(t,e,n){"use strict";function i(t,e,n,i,r,u,o,l){var a,s="function"==typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=n,s._compiled=!0),i&&(s.functional=!0),u&&(s._scopeId="data-v-"+u),o?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},s._ssrRegister=a):r&&(a=l?function(){r.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:r),a)if(s.functional){s._injectStyles=a;var m=s.render;s.render=function(t,e){return a.call(e),m(t,e)}}else{var c=s.beforeCreate;s.beforeCreate=c?[].concat(c,a):[a]}return{exports:t,options:s}}n.d(e,"a",(function(){return i}))},149:function(t,e,n){},209:function(t,e,n){"use strict";n.r(e);var i={name:"nut-countup",props:{initNum:{type:Number,default:0},endNum:{type:Number,default:0},speed:{type:Number,default:1},toFixed:{type:Number,default:0},during:{type:Number,default:1e3},startFlag:{type:Boolean,default:!0},numWidth:{type:Number,default:20},numHeight:{type:Number,default:20},scrolling:{type:Boolean,default:!1},customBgImg:{type:String,default:""},customSpacNum:{type:Number,default:0},customChangeNum:{type:Number,default:1},type:{type:String,default:""},machineNum:{type:Number,default:3},machinePrizeNum:{type:Number,default:0},machinePrizeLevel:{type:Number,default:0},machineTrunMore:{type:Number,default:0}},data:function(){return{valFlag:!1,current:0,sortFlag:"add",initDigit1:0,initDigit2:0,to0_10:[0,1,2,3,4,5,6,7,8,9,0],to10_0:[0,9,8,7,6,5,4,3,2,1,1],timer:null,totalCount:0,pointNum:0,numberVal:0,num_total_len:0,relNum:0,customNumber:1,prizeLevelTrun:0,prizeY:[],prizeYPrev:[],finshMachine:0,notPrize:[],typeMachine:""}},computed:{},watch:{customChangeNum:function(t,e){this.customNumber=t,this.countGo()},machinePrizeLevel:function(t,e){this.prizeLevelTrun=t},initNum:function(t,e){this.current=t,this.valFlag=!1,this.valChange()},endNum:function(t,e){this.current=this.initNum,this.valFlag=!1,this.valChange()}},mounted:function(){this.current=this.initNum,this.valChange()},beforeDestroy:function(){clearInterval(this.timer),this.timer=null},methods:{valChange:function(){var t=this;if(this.valFlag)return!1;this.startFlag&&(this.scrolling||this.customBgImg?"machine"!=this.type&&this.countGo():(this.countChange(),setTimeout((function(){t.valFlag=!0}),300)))},clearInterval:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){clearInterval(this.timer),this.timer=null})),calculation:function(t,e,n){var i=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,u=Math.pow(10,Math.max(i,r));return"-"==n?(t*u-e*u).toFixed(0)/u:(t*u+e*u).toFixed(0)/u},countChange:function(){var t=this,e=this.endNum,n=this.initNum,i=this.speed,r=this.toFixed,u=setInterval((function(){n>e?t.current<=e||t.current<=i?(t.current=e.toFixed(r),clearInterval(u),t.$emit("scroll-end"),t.valFlag=!1):t.current=(parseFloat(t.current)-parseFloat(i)).toFixed(r):t.current>=e?(t.current=e.toFixed(r),clearInterval(u),t.$emit("scroll-end"),t.valFlag=!1):t.current=(parseFloat(t.current)+parseFloat(i)).toFixed(r)}),this.during)},topNumber:function(t){var e=this.num_total_len,n=this.pointNum,i=this.initDigit1,r=this.initDigit2,u=this.sortFlag,o="add"==u||"equal"==u?r[t-(e-n)]:10-r[t-(e-n)],l="add"==u||"equal"==u?i[t]:10-i[t],a=t>e-n-1?100*-o+"%":t<=i.length-1?100*-l+"%":0;return"-1000%"==a&&(a=0),a},turnNumber:function(t){var e=this.num_total_len,n=this.pointNum,i=this.initDigit1,r=this.initDigit2,u=(this.sortFlag,r[t-(e-n)]);return t>e-n-1?u||0:t<=i.length-1?i[t]:0},countGo:function(){var t,e,n,i,r=this,u=this.initNum,o=this.endNum,l=this.toFixed,a=this.customBgImg;a&&(u=this.customNumber),0!=u?(0!=l&&(u=u.toFixed(l)),String(u).indexOf(".")>-1?(t=String(u).split(".")[0].length,e=String(u).split(".")[1].length):(t=String(u).length,e=0)):(t=1,e=0),0!=o?(0!=l&&(o=o.toFixed(l)),String(o).indexOf(".")>-1?(n=String(o).split(".")[0].length,i=String(o).split(".")[1].length):(n=String(o).length,i=0)):(n=1,i=0);var s=t>=n?t:n,m=e>=i?e:i;this.num_total_len=s+m,this.pointNum=m,u>o?(this.sortFlag="reduce",this.to0_10=[0,9,8,7,6,5,4,3,2,1,0],this.totalCount=this.calculation(u,o,"-"),this.numberVal=String(u)):u<o?(this.sortFlag="add",this.to0_10=[0,1,2,3,4,5,6,7,8,9,0],this.totalCount=this.calculation(o,u,"-"),this.numberVal=String(o)):this.sortFlag="equal";for(var c=1,h=0;h<this.pointNum;h++)c*=10;var p=this.numberVal*c;if(this.relNum=p,0!=l&&(this.pointNum=this.numberVal.split(".")[1]?this.numberVal.split(".")[1].length:0,this.num_total_len=String(p).length),String(u).indexOf(".")>-1){var g=String(u).split(".");this.initDigit1=g[0],this.initDigit2=g[1]}else this.initDigit1=String(u),this.initDigit2="0";this.scrolling&&!a?this.$nextTick((function(){if("equal"==r.sortFlag)return!1;var t=r.$refs.numberItem[r.num_total_len-1];r.runTurn(t)})):this.imgNumberScroll()},runTurn:function(t){var e=this,n=this;n.clearInterval();var i=1;0!=this.pointNum&&(i=1/Math.pow(10,this.pointNum)),n.timer=setInterval((function(){n.runStep(t),n.totalCount=n.calculation(n.totalCount,i,"-"),n.totalCount<=0&&(n.clearInterval(),e.$emit("scroll-end"),e.valFlag=!1)}),n.during)},runStep:function(t){var e=this,n=t.getAttribute("turn-number"),i=null;if(i="add"==e.sortFlag?parseInt(n)+1:parseInt(n)-1>=0?parseInt(n)-1:9,t.setAttribute("turn-number",i),"none 0s ease 0s"!=t.style.transition&&1!=i&&t.style.transition||(t.style.transition="all linear ".concat(e.during,"ms")),10==i||"reduce"==e.sortFlag&&0==i){var r=null;t.style.top="-".concat("add"==e.sortFlag?100*i:100*(10-i),"%"),t.setAttribute("turn-number",0),r=setTimeout((function(){r&&clearTimeout(r),t.style.transition="none",t.style.top=0,10==i&&t.previousSibling&&e.runStep(t.previousSibling)}),.975*e.during)}else t.style.top="-".concat("add"==e.sortFlag?100*i:100*(10-i),"%");"-100%"==t.style.top&&"reduce"==e.sortFlag&&e.runStep(t.previousSibling)},imgNumberScroll:function(){var t=this,e=this,n=1;0!=e.pointNum&&(n=Math.pow(10,e.pointNum)),this.$nextTick((function(){var i=e.$el.querySelector(".run-number-img");setTimeout((function(){e.relNum=e.calculation(e.relNum,n*e.speed,"+")}),e.during),i.addEventListener("webkitTransitionEnd",(function(){t.$emit("scroll-end"),t.valFlag=!1,setTimeout((function(){e.relNum=e.calculation(e.relNum,n*e.speed,"+")}),e.during)}))}))},generateRandom:function(){for(this.notPrize=[];this.notPrize.length<3;){var t=Math.floor(Math.random()*this.machinePrizeNum+1);-1==this.notPrize.indexOf(t)&&this.notPrize.push(t)}},machineLuck:function(){var t=this;this.machineTrunMore=this.machineTrunMore<0?0:this.machineTrunMore;var e=this.numHeight*this.machinePrizeNum;this.prizeLevelTrun<0&&this.generateRandom();for(var n=function(n){setTimeout((function(){var i=e*(n+1+parseFloat(t.machineTrunMore));0!=t.prizeYPrev.length&&t.$set(t.prizeY,n,t.prizeYPrev[n]);var r=t.prizeYPrev[n]?t.prizeYPrev[n]:0,u=i+r+(t.machinePrizeNum-t.prizeLevelTrun+1)*t.numHeight+(e-r);t.prizeLevelTrun<0&&(u+=t.numHeight*t.notPrize[n]),t.scrollTime(n,u,r)}),500*n)},i=0;i<this.machineNum;i++)n(i)},scrollTime:function(t,e,n){var i=this,r=setInterval((function(){if(n<=e)n+=10,i.$set(i.prizeY,t,parseFloat(n));else if(clearInterval(r),r=null,i.finshMachine+=1,i.$set(i.prizeY,t,e),i.finshMachine==i.machineNum){var u=i.numHeight*i.machinePrizeNum;i.prizeYPrev=[],JSON.parse(JSON.stringify(i.prizeY)).forEach((function(t){for(var e=t;e>u;)e-=u;i.prizeYPrev.push(e)})),setTimeout((function(){i.finshMachine=0,i.prizeLevelTrun<0?(i.$emit("scroll-end",!1),i.valFlag=!1):(i.$emit("scroll-end",!0),i.valFlag=!1)}),130)}}),30)}}},r=n(0),u=Object(r.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"nut-countup"},[""!=t.customBgImg?["machine"==t.type?[n("ul",{staticClass:"run-number-machine-img",style:{height:t.numHeight+"px"}},t._l(t.machineNum,(function(e,i){return n("li",{key:"mImg"+i,ref:"run-number-machine-img-li",refInFor:!0,staticClass:"run-number-machine-img-li",style:{width:t.numWidth+"px",height:t.numHeight+"px",backgroundImage:"url("+t.customBgImg+")",backgroundPositionY:t.prizeY[i]+"px"}})})),0)]:[n("ul",{staticClass:"run-number-img",style:{height:t.numHeight+"px"}},[t._l(t.num_total_len,(function(e,i){return n("li",{key:"cImg"+i,staticClass:"run-number-img-li",style:{width:t.numWidth+"px",height:t.numHeight+"px",left:t.numWidth*(i>t.num_total_len-t.pointNum-1?i==t.num_total_len-t.pointNum?1.5*i:1.3*i:i)+"px",backgroundImage:"url("+t.customBgImg+")",backgroundPosition:"0 "+-(String(t.relNum)[i]*t.numHeight+t.customSpacNum*String(t.relNum)[i])+"px",transition:"all linear "+t.during/10+"ms"}})})),t._v(" "),t.pointNum>0?n("div",{staticClass:"pointstyl",style:{width:t.numWidth/2+"px",bottom:0,left:t.numWidth*(t.num_total_len-t.pointNum)*1.1+"px",fontSize:"30px"}},[t._v(".")]):t._e()],2)]]:[t.scrolling?n("ul",{staticClass:"run-number",style:{width:t.numWidth*t.num_total_len+t.numWidth/3+"px",height:t.numHeight+"px",lineHeight:t.numHeight+"px"}},[t._l(t.num_total_len,(function(e,i){return n("li",{key:e,ref:"numberItem",refInFor:!0,style:{top:t.topNumber(i),left:t.numWidth*(i>t.num_total_len-t.pointNum-1?1.1*i:i)+"px"},attrs:{"turn-number":t.turnNumber(i)}},t._l(t.to0_10,(function(e,i){return n("span",{key:"dote"+i,style:{width:t.numWidth+"px",height:t.numHeight+"px",lineHeight:t.numHeight+"px"}},[t._v("\n "+t._s(e)+"\n ")])})),0)})),t._v(" "),t.pointNum>0?n("div",{staticClass:"pointstyl",style:{width:t.numWidth/3+"px",height:t.numHeight+"px",lineHeight:t.numHeight+"px",top:0,left:t.numWidth*(t.num_total_len-t.pointNum)+"px"}},[t._v(".")]):t._e()],2):[t._v("\n "+t._s(t.current)+"\n ")]]],2)}),[],!1,null,null,null).exports;n(149);u.install=function(t){t.component(u.name,u)};e.default=u}})}));
|
|
7
7
|
//# sourceMappingURL=countup.js.map
|