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.

72 lines
1.9 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
return {
list: [
{
id: "form",
name: "表单组件",
open: false,
pages: ["button"]
}
]
};
},
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;
common_vendor.index.navigateTo({
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: item.open ? "rotate(180deg)" : "",
c: common_vendor.n(item.open ? "" : ""),
d: common_vendor.o(($event) => $options.triggerCollapse(index, item.id), item.id),
e: item.open
}, item.open ? {
f: common_vendor.f(item.pages, (item2, key, i1) => {
return {
a: common_vendor.t(item2.name ? item2.name : item2),
b: key,
c: common_vendor.o(($event) => $options.goDetailPage(item.id, item2), key)
};
})
} : {}, {
g: item.id
});
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map