You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.3 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
return {
list: [
{
id: "form",
name: "表单组件",
open: false,
pages: ["button", "checkbox", "form", "input", "label", "picker", "picker-view", "radio", "slider", "switch", "textarea"]
}
]
};
},
onLoad() {
},
methods: {
triggerCollapse(e, id) {
if (!this.list[e].pages) {
this.goDetailPage("", this.list[e].url);
return;
}
for (var i = 0; i < this.list.length; ++i) {
if (e === i) {
this.list[i].open = !this.list[i].open;
} else {
this.list[i].open = false;
}
}
},
goDetailPage(panel, e) {
if (typeof e === "string") {
const url = "/pages/component/" + e + "/" + e;
if (this.hasLeftWin) {
common_vendor.index.reLaunch({
url
});
} else {
common_vendor.index.navigateTo({
url
});
}
} else {
if (this.hasLeftWin) {
common_vendor.index.reLaunch({
url: e.url
});
} else {
common_vendor.index.navigateTo({
url: e.url
});
}
}
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.f($data.list, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.name),
b: common_vendor.n(item.open ? "" : ""),
c: common_vendor.o(($event) => $options.triggerCollapse(index, item.id), item.id),
d: item.open
}, item.open ? {
e: common_vendor.f(item.pages, (item2, key, i1) => {
return {
a: common_vendor.t(item2.name ? item2.name : item2),
b: _ctx.leftWinActive === (item2.url ? item2.url.split("/")[3] : item2) && _ctx.hasLeftWin ? 1 : "",
c: key,
d: common_vendor.o(($event) => $options.goDetailPage(item.id, item2), key)
};
})
} : {}, {
f: item.id
});
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/main/index.js.map