| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- "use strict";
- const common_vendor = require("../common/vendor.js");
- const utils_file = require("../utils/file.js");
- const _sfc_main = {
- __name: "TabBar",
- props: {
- placeholder: { type: Boolean, default: false },
- // 是否显示占位
- fixed: { type: Boolean, default: true }
- // 是否定位
- },
- setup(__props) {
- const menus = [
- { title: "首页", link: "/pages/index/index", img: "img/tabbar/index1.png", imgon: "img/tabbar/index2.png" },
- { title: "扫码点餐", link: "/pages/numberOfDiners/index", img: "img/tabbar/qr2.png", imgon: "img/tabbar/qr.png" },
- { title: "我的", link: "/pages/personal/index", img: "img/tabbar/personal1.png", imgon: "img/tabbar/personal2.png" }
- ];
- const props = __props;
- const getTabBarWrapStyle = common_vendor.computed(() => ({
- position: props.fixed ? "fixed" : "relative"
- }));
- function go(url) {
- if (url === common_vendor.unref(getPath))
- return;
- common_vendor.index.reLaunch({ url });
- }
- const getPath = common_vendor.computed(() => {
- const pages = getCurrentPages();
- common_vendor.index.__f__("log", "at components/TabBar.vue:55", "/" + pages[pages.length - 1].route);
- return "/" + pages[pages.length - 1].route;
- });
- return (_ctx, _cache) => {
- return common_vendor.e({
- a: __props.placeholder && __props.fixed
- }, __props.placeholder && __props.fixed ? {} : {}, {
- b: getPath.value === menus[0].link
- }, getPath.value === menus[0].link ? {
- c: common_vendor.unref(utils_file.getFileUrl)(menus[0].img)
- } : {
- d: common_vendor.unref(utils_file.getFileUrl)(menus[0].imgon)
- }, {
- e: common_vendor.t(menus[0].title),
- f: getPath.value === menus[0].link ? 1 : "",
- g: common_vendor.o(($event) => go(menus[0].link)),
- h: common_vendor.unref(utils_file.getFileUrl)(menus[1].img),
- i: common_vendor.unref(utils_file.getFileUrl)(menus[1].imgon),
- j: common_vendor.o(($event) => go(menus[1].link)),
- k: getPath.value === menus[2].link
- }, getPath.value === menus[2].link ? {
- l: common_vendor.unref(utils_file.getFileUrl)(menus[2].img)
- } : {
- m: common_vendor.unref(utils_file.getFileUrl)(menus[2].imgon)
- }, {
- n: common_vendor.t(menus[2].title),
- o: getPath.value === menus[2].link ? 1 : "",
- p: common_vendor.o(($event) => go(menus[2].link)),
- q: common_vendor.s(getTabBarWrapStyle.value)
- });
- };
- }
- };
- const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-89ca1f91"]]);
- wx.createComponent(Component);
- //# sourceMappingURL=../../.sourcemap/mp-weixin/components/TabBar.js.map
|