52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../common/vendor.js");
|
|
if (!Math) {
|
|
AppIcon();
|
|
}
|
|
const AppIcon = () => "./AppIcon.js";
|
|
const _sfc_main = {
|
|
__name: "TabBar",
|
|
props: {
|
|
currentPage: {
|
|
type: String,
|
|
default: "home"
|
|
}
|
|
},
|
|
emits: ["change"],
|
|
setup(__props, { emit: __emit }) {
|
|
const props = __props;
|
|
const emit = __emit;
|
|
function switchTab(pageName) {
|
|
if (props.currentPage === pageName) return;
|
|
emit("change", pageName);
|
|
}
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: common_vendor.p({
|
|
name: "home",
|
|
size: 16,
|
|
color: props.currentPage === "home" ? "#16a34a" : "#64748b"
|
|
}),
|
|
b: props.currentPage === "home" ? 1 : "",
|
|
c: common_vendor.o(($event) => switchTab("home")),
|
|
d: common_vendor.p({
|
|
name: "report",
|
|
size: 16,
|
|
color: props.currentPage === "report" ? "#16a34a" : "#64748b"
|
|
}),
|
|
e: props.currentPage === "report" ? 1 : "",
|
|
f: common_vendor.o(($event) => switchTab("report")),
|
|
g: common_vendor.p({
|
|
name: "mine",
|
|
size: 16,
|
|
color: props.currentPage === "mine" ? "#16a34a" : "#64748b"
|
|
}),
|
|
h: props.currentPage === "mine" ? 1 : "",
|
|
i: common_vendor.o(($event) => switchTab("mine"))
|
|
};
|
|
};
|
|
}
|
|
};
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7d9a6b19"]]);
|
|
wx.createComponent(Component);
|