11 lines
6.0 KiB
JavaScript
11 lines
6.0 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["tuniao-ui/components/tn-tabbar/tn-tabbar"],{2648:function(t,e,n){"use strict";n.r(e);var o=n("da43"),a=n("9d16");for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);n("fee0");var r=n("f0c5"),u=Object(r["a"])(a["default"],o["b"],o["c"],!1,null,"5c5e8a4b",null,!1,o["a"],void 0);e["default"]=u.exports},"42f4":function(t,e,n){"use strict";(function(t){var o=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=o(n("2eee")),i=o(n("c973")),r={name:"tn-tabbar",props:{value:{type:[String,Number],default:0},show:{type:Boolean,default:!0},list:{type:Array,default:function(){return[]}},height:{type:Number,default:100},outHeight:{type:Number,default:100},bgColor:{type:String,default:"#FFFFFF"},iconSize:{type:Number,default:40},fontSize:{type:Number,default:24},activeColor:{type:String,default:"#01BEFF"},inactiveColor:{type:String,default:"#AAAAAA"},activeIconColor:{type:String,default:"#01BEFF"},inactiveIconColor:{type:String,default:"#AAAAAA"},activeStyle:{type:Object,default:function(){return{}}},shadow:{type:Boolean,default:!0},animation:{type:Boolean,default:!1},animationMode:{type:String,default:"scale"},fixed:{type:Boolean,default:!0},safeAreaInsetBottom:{type:Boolean,default:!1},beforeSwitch:{type:Function,default:null}},computed:{elColor:function(){var t=this;return function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.list[e],a="";return a=e===t.value?o["activeColor"]||t.activeColor:o["inactiveColor"]||t.inactiveColor,n?""!==t.$tn.color.getFontColorStyle(a)?a:"":""===t.$tn.color.getFontColorStyle(a)?a:""}},elIconColor:function(){var t=this;return function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.list[e],a="";return a=e===t.value?o["activeIconColor"]||t.activeIconColor:o["inactiveIconColor"]||t.inactiveIconColor,n?""!==t.$tn.color.getFontColorStyle(a)?a:"":""===t.$tn.color.getFontColorStyle(a)?a+" tn-tabbar__content__item__icon--clip":""}},elIcon:function(){var t=this;return function(e){var n=t.list[e];return e===t.value?n["activeIcon"]:n["inactiveIcon"]}},itemButtonClass:function(){var t=this;return function(e){var n="";return t.list[e]["out"]?(n+="tn-tabbar__content__item__button--out",""===t.$tn.color.getFontColorStyle(t.activeIconColor)&&(n+=" ".concat(t.activeIconColor)),t.value===e&&(n+=" tn-tabbar__content__item__button--out--animation--".concat(t.animationMode))):(n+="tn-tabbar__content__item__button",t.value===e&&(n+=" tn-tabbar__content__item__button--animation--".concat(t.animationMode))),n}},itemButtonStyle:function(){var t=this;return function(e){var n={};return console.log(),t.list[e]["out"]?(""!==t.$tn.color.getFontColorStyle(t.activeIconColor)&&(t.value,n.backgroundColor="#ffffff"),n.width="".concat(t.outHeight-20,"rpx"),n.height="".concat(t.outHeight-20,"rpx"),n.top="-".concat(.3*t.outHeight,"rpx"),n):n}},isImage:function(){var t=this;return function(e){var n=t.list[e]["activeIcon"];return-1!==n.indexOf("/")}}},data:function(){return{outItemLeft:"50%",outItemIndex:-1,tabbatItemInfo:[]}},watch:{},created:function(){this.getOutItemIndex()},mounted:function(){var t=this;this.$nextTick((function(){t.getTabbarItem()}))},methods:{getTabbarItem:function(){for(var e=this,n=t.createSelectorQuery().in(this),o=0;o<this.list.length;o++)n.select("#tabbar_item_".concat(o)).fields({size:!0,rect:!0});n.exec((function(t){t?(e.tabbatItemInfo=t.map((function(t){return{left:t.left,width:t.width}})),e.updateOutItemLeft()):setTimeout((function(){e.getTabbarItem()}),10)}))},getOutItemIndex:function(){this.outItemIndex=this.list.findIndex((function(t){return t.hasOwnProperty("out")&&t.out}))},clickItemHandler:function(t){var e=this;return(0,i.default)(a.default.mark((function n(){var o;return a.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(o=e.beforeSwitch.bind(e.$tn.$parent.call(e))(t),!o||"function"!==typeof o.then){n.next=7;break}return n.next=5,o.then((function(n){e.switchTab(t)})).catch((function(t){}));case 5:n.next=8;break;case 7:!0===o&&e.switchTab(t);case 8:n.next=11;break;case 10:e.switchTab(t);case 11:case"end":return n.stop()}}),n)})))()},switchTab:function(t){this.$emit("change",t),this.$emit("input",t)},updateOutItemLeft:function(){var t=this.list.findIndex((function(t){return t.out}));-1!==t&&(this.outItemLeft=this.tabbatItemInfo[t].left+this.tabbatItemInfo[t].width/2+"px")}}};e.default=r}).call(this,n("543d")["default"])},"947f":function(t,e,n){},"9d16":function(t,e,n){"use strict";n.r(e);var o=n("42f4"),a=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);e["default"]=a.a},da43:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));var o={tnBadge:function(){return Promise.all([n.e("common/vendor"),n.e("tuniao-ui/components/tn-badge/tn-badge")]).then(n.bind(null,"cb40"))}},a=function(){var t=this,e=t.$createElement,n=(t._self._c,t.show?t.__map(t.list,(function(e,n){var o=t.__get_orig(e),a=t.__get_style([t.itemButtonStyle(n)]),i=t.itemButtonClass(n),r=t.isImage(n),u=r?t.elIcon(n):null,c=r?null:t.elIcon(n),l=r?null:t.elIconColor(n,!1),f=r?null:t.elIconColor(n),s=e.out||!e.count&&!e.dot?null:t.$tn.number.formatNumberString(e.count),d=t.elColor(n,!1),b=t.elColor(n);return{$orig:o,s0:a,m0:i,m1:r,m2:u,m3:c,m4:l,m5:f,g0:s,m6:d,m7:b}})):null);t._isMounted||(t.e0=function(t){t.stopPropagation(),t.preventDefault()}),t.$mp.data=Object.assign({},{$root:{l0:n}})},i=[]},fee0:function(t,e,n){"use strict";var o=n("947f"),a=n.n(o);a.a}}]);
|
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
|
'tuniao-ui/components/tn-tabbar/tn-tabbar-create-component',
|
|
{
|
|
'tuniao-ui/components/tn-tabbar/tn-tabbar-create-component':(function(module, exports, __webpack_require__){
|
|
__webpack_require__('543d')['createComponent'](__webpack_require__("2648"))
|
|
})
|
|
},
|
|
[['tuniao-ui/components/tn-tabbar/tn-tabbar-create-component']]
|
|
]);
|