u-tabbar.js 4.3 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uview-ui/components/u-tabbar/u-tabbar"],{"0a88":function(t,e,n){"use strict";var i=n("2f2e"),u=n.n(i);u.a},"2f2e":function(t,e,n){},"37c6":function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}));var i={uIcon:function(){return n.e("uview-ui/components/u-icon/u-icon").then(n.bind(null,"c500"))},uBadge:function(){return n.e("uview-ui/components/u-badge/u-badge").then(n.bind(null,"cc5e"))}},u=function(){var t=this,e=t.$createElement,n=(t._self._c,t.show?t.$u.addUnit(t.height):null),i=t.show?t.__map(t.list,(function(e,n){var i=t.__get_orig(e),u=t.elIconPath(n),a=t.elColor(n),r=e.count?t.getOffsetRight(e.count,e.isDot):null,o=t.elColor(n);return{$orig:i,m0:u,m1:a,m2:r,m3:o}})):null,u=t.show?t.$u.addUnit(t.height):null;t._isMounted||(t.e0=function(t){t.stopPropagation(),t.preventDefault()}),t.$mp.data=Object.assign({},{$root:{g0:n,l0:i,g1:u}})},a=[]},ae9d:function(t,e,n){"use strict";n.r(e);var i=n("e656"),u=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=u.a},e579:function(t,e,n){"use strict";n.r(e);var i=n("37c6"),u=n("ae9d");for(var a in u)"default"!==a&&function(t){n.d(e,t,(function(){return u[t]}))}(a);n("0a88");var r,o=n("f0c5"),c=Object(o["a"])(u["default"],i["b"],i["c"],!1,null,"0a28ec32",null,!1,i["a"],r);e["default"]=c.exports},e656:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=u(n("a34a"));function u(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n,i,u,a,r){try{var o=t[a](r),c=o.value}catch(l){return void n(l)}o.done?e(c):Promise.resolve(c).then(i,u)}function r(t){return function(){var e=this,n=arguments;return new Promise((function(i,u){var r=t.apply(e,n);function o(t){a(r,i,u,o,c,"next",t)}function c(t){a(r,i,u,o,c,"throw",t)}o(void 0)}))}}var o={props:{show:{type:Boolean,default:!0},value:{type:[String,Number],default:0},bgColor:{type:String,default:"#ffffff"},height:{type:[String,Number],default:"50px"},iconSize:{type:[String,Number],default:40},midButtonSize:{type:[String,Number],default:90},activeColor:{type:String,default:"#303133"},inactiveColor:{type:String,default:"#606266"},midButton:{type:Boolean,default:!1},list:{type:Array,default:function(){return[]}},beforeSwitch:{type:Function,default:null},borderTop:{type:Boolean,default:!0},hideTabBar:{type:Boolean,default:!0}},data:function(){return{midButtonLeft:"50%",pageUrl:""}},created:function(){this.hideTabBar&&t.hideTabBar();var e=getCurrentPages();this.pageUrl=e[e.length-1].route},computed:{elIconPath:function(){var t=this;return function(e){var n=t.list[e].pagePath;return n?n==t.pageUrl||n=="/"+t.pageUrl?t.list[e].selectedIconPath:t.list[e].iconPath:e==t.value?t.list[e].selectedIconPath:t.list[e].iconPath}},elColor:function(){var t=this;return function(e){var n=t.list[e].pagePath;return n?n==t.pageUrl||n=="/"+t.pageUrl?t.activeColor:t.inactiveColor:e==t.value?t.activeColor:t.inactiveColor}}},mounted:function(){this.midButton&&this.getMidButtonLeft()},methods:{clickHandler:function(t){var e=this;return r(i.default.mark((function n(){var u;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!e.beforeSwitch||"function"!==typeof e.beforeSwitch){n.next=10;break}if(u=e.beforeSwitch.bind(e.$u.$parent.call(e))(t),!u||"function"!==typeof u.then){n.next=7;break}return n.next=5,u.then((function(n){e.switchTab(t)})).catch((function(t){}));case 5:n.next=8;break;case 7:!0===u&&e.switchTab(t);case 8:n.next=11;break;case 10:e.switchTab(t);case 11:case"end":return n.stop()}}),n)})))()},switchTab:function(e){this.$emit("change",e),this.list[e].pagePath?t.switchTab({url:this.list[e].pagePath}):this.$emit("input",e)},getOffsetRight:function(t,e){return e?-20:t>9?-40:-30},getMidButtonLeft:function(){var t=this.$u.sys().windowWidth;this.midButtonLeft=t/2+"px"}}};e.default=o}).call(this,n("543d")["default"])}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'uview-ui/components/u-tabbar/u-tabbar-create-component',
  4. {
  5. 'uview-ui/components/u-tabbar/u-tabbar-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("e579"))
  7. })
  8. },
  9. [['uview-ui/components/u-tabbar/u-tabbar-create-component']]
  10. ]);