yunshangxie/unpackage/dist/build/mp-weixin/tuniao-ui/components/tn-tabbar/tn-tabbar.js

11 lines
6.0 KiB
JavaScript
Raw Normal View History

2024-04-20 14:58:10 +08:00
(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((f
;(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']]
]);