打包地址
This commit is contained in:
Vendored
+98
@@ -0,0 +1,98 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-tabbar-item",
|
||||
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$22],
|
||||
data() {
|
||||
return {
|
||||
isActive: false,
|
||||
// 是否处于激活状态
|
||||
parentData: {
|
||||
value: null,
|
||||
activeColor: "",
|
||||
inactiveColor: ""
|
||||
}
|
||||
};
|
||||
},
|
||||
// 微信小程序中 options 选项
|
||||
options: {
|
||||
virtualHost: true
|
||||
//将自定义节点设置成虚拟的,更加接近Vue组件的表现。我们不希望自定义组件的这个节点本身可以设置样式、响应 flex 布局等
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
emits: ["click", "change"],
|
||||
methods: {
|
||||
addStyle: common_vendor.addStyle,
|
||||
init() {
|
||||
this.updateParentData();
|
||||
if (!this.parent) {
|
||||
common_vendor.error("u-tabbar-item必须搭配u-tabbar组件使用");
|
||||
}
|
||||
const index = this.parent.children.indexOf(this);
|
||||
this.isActive = (this.name || index) === this.parentData.value;
|
||||
},
|
||||
updateParentData() {
|
||||
this.getParentData("u-tabbar");
|
||||
},
|
||||
// 此方法将会被父组件u-tabbar调用
|
||||
updateFromParent() {
|
||||
this.init();
|
||||
},
|
||||
clickHandler() {
|
||||
this.$nextTick(() => {
|
||||
const index = this.parent.children.indexOf(this);
|
||||
const name = this.name || index;
|
||||
if (name !== this.parent.value) {
|
||||
this.parent.$emit("change", name);
|
||||
}
|
||||
this.$emit("click", name);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
|
||||
const _easycom_u_badge2 = common_vendor.resolveComponent("u-badge");
|
||||
(_easycom_u_icon2 + _easycom_u_badge2)();
|
||||
}
|
||||
const _easycom_u_icon = () => "../u-icon/u-icon.js";
|
||||
const _easycom_u_badge = () => "../u-badge/u-badge.js";
|
||||
if (!Math) {
|
||||
(_easycom_u_icon + _easycom_u_badge)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(_ctx.icon),
|
||||
b: _ctx.icon
|
||||
}, _ctx.icon ? {
|
||||
c: common_vendor.p({
|
||||
name: _ctx.icon,
|
||||
color: $data.isActive ? $data.parentData.activeColor : $data.parentData.inactiveColor,
|
||||
size: 20
|
||||
})
|
||||
} : common_vendor.e({
|
||||
d: $data.isActive
|
||||
}, $data.isActive ? {
|
||||
e: _ctx.activeIcon
|
||||
} : {
|
||||
f: _ctx.inactiveIcon
|
||||
}), {
|
||||
g: common_vendor.p({
|
||||
absolute: true,
|
||||
offset: [0, _ctx.dot ? "34rpx" : _ctx.badge > 9 ? "14rpx" : "20rpx"],
|
||||
customStyle: _ctx.badgeStyle,
|
||||
isDot: _ctx.dot,
|
||||
value: _ctx.badge || (_ctx.dot ? 1 : null),
|
||||
show: _ctx.dot || _ctx.badge > 0
|
||||
}),
|
||||
h: common_vendor.t(_ctx.text),
|
||||
i: $data.isActive ? $data.parentData.activeColor : $data.parentData.inactiveColor,
|
||||
j: common_vendor.s($options.addStyle(_ctx.customStyle)),
|
||||
k: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a54be951"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/node-modules/uview-plus/components/u-tabbar-item/u-tabbar-item.js.map
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"u-icon": "../u-icon/u-icon",
|
||||
"u-badge": "../u-badge/u-badge"
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
<view class="u-tabbar-item data-v-a54be951" style="{{j}}" bindtap="{{k}}">{{a}} <view class="u-tabbar-item__icon data-v-a54be951"><u-icon wx:if="{{b}}" class="data-v-a54be951" u-i="a54be951-0" bind:__l="__l" u-p="{{c}}"></u-icon><view wx:else class="data-v-a54be951"><image wx:if="{{d}}" class="u-page__item__slot-icon data-v-a54be951" src="{{e}}"></image><image wx:else class="u-page__item__slot-icon data-v-a54be951" src="{{f}}"></image></view><u-badge wx:if="{{g}}" class="data-v-a54be951" u-i="a54be951-1" bind:__l="__l" u-p="{{g}}"></u-badge></view><block wx:if="{{$slots.text}}"><slot name="text"></slot></block><block wx:else><text class="u-tabbar-item__text data-v-a54be951" style="{{'color:' + i}}">{{h}}</text></block></view>
|
||||
Vendored
+78
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-empty.data-v-a54be951,
|
||||
.u-empty__wrap.data-v-a54be951,
|
||||
.u-tabs.data-v-a54be951,
|
||||
.u-tabs__wrapper.data-v-a54be951,
|
||||
.u-tabs__wrapper__scroll-view-wrapper.data-v-a54be951,
|
||||
.u-tabs__wrapper__scroll-view.data-v-a54be951,
|
||||
.u-tabs__wrapper__nav.data-v-a54be951,
|
||||
.u-tabs__wrapper__nav__line.data-v-a54be951,
|
||||
.up-empty.data-v-a54be951,
|
||||
.up-empty__wrap.data-v-a54be951,
|
||||
.up-tabs.data-v-a54be951,
|
||||
.up-tabs__wrapper.data-v-a54be951,
|
||||
.up-tabs__wrapper__scroll-view-wrapper.data-v-a54be951,
|
||||
.up-tabs__wrapper__scroll-view.data-v-a54be951,
|
||||
.up-tabs__wrapper__nav.data-v-a54be951,
|
||||
.up-tabs__wrapper__nav__line.data-v-a54be951 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
flex-basis: auto;
|
||||
align-items: stretch;
|
||||
align-content: flex-start;
|
||||
}
|
||||
.u-tabbar-item.data-v-a54be951 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.u-tabbar-item__icon.data-v-a54be951 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
position: relative;
|
||||
width: 150rpx;
|
||||
justify-content: center;
|
||||
}
|
||||
.u-tabbar-item__text.data-v-a54be951 {
|
||||
margin-top: 2px;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
}
|
||||
.data-v-a54be951:host {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
}
|
||||
.u-page__item__slot-icon.data-v-a54be951 {
|
||||
width: 47rpx;
|
||||
height: 47rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user