feat: 轮播组件优化
This commit is contained in:
57
unpackage/dist/dev/mp-weixin/components/ImageSwiper/index.js
vendored
Normal file
57
unpackage/dist/dev/mp-weixin/components/ImageSwiper/index.js
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const active = common_vendor.ref(0);
|
||||
const thumbnails = common_vendor.ref([
|
||||
{
|
||||
url: "https://fastly.picsum.photos/id/866/654/400.jpg?hmac=z3vI4CYrpnXEgimSlJCDwXRxEa-UDHiRwzGEyB8V-po",
|
||||
description: "瑶山古寨"
|
||||
},
|
||||
{
|
||||
url: "https://fastly.picsum.photos/id/284/654/400.jpg?hmac=89XRCJxYTblKIFGLOp6hJ9U0GC8BQrcnJwE5pG21NAk",
|
||||
description: "民俗表演"
|
||||
},
|
||||
{
|
||||
url: "https://fastly.picsum.photos/id/281/654/400.jpg?hmac=hcAJB7y2Xz3DVuz6S4XeQZgzaTJ_QWnxtbnaagZL6Fs",
|
||||
description: "特色美食"
|
||||
},
|
||||
{
|
||||
url: "https://fastly.picsum.photos/id/435/654/400.jpg?hmac=TSVDxfo-zXbunxNQK0erSG_nmKcS20xfhbQsCAXLlHo",
|
||||
description: "传统服饰"
|
||||
},
|
||||
{
|
||||
url: "https://fastly.picsum.photos/id/737/654/400.jpg?hmac=VED05oEK3XB0Aa_DUVoZjTAf0bHjAmNYyJky4lq5vVo",
|
||||
description: "其他"
|
||||
}
|
||||
]);
|
||||
const handleThumbnailClick = (index) => {
|
||||
active.value = index;
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.f(thumbnails.value, (item, index, i0) => {
|
||||
return {
|
||||
a: item.url,
|
||||
b: index
|
||||
};
|
||||
}),
|
||||
b: active.value,
|
||||
c: common_vendor.t(active.value + 1),
|
||||
d: common_vendor.t(thumbnails.value.length),
|
||||
e: common_vendor.f(thumbnails.value, (thumb, index, i0) => {
|
||||
return {
|
||||
a: thumb.url,
|
||||
b: common_vendor.t(thumb.description),
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => handleThumbnailClick(index), index)
|
||||
};
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cc2009df"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/ImageSwiper/index.js.map
|
||||
Reference in New Issue
Block a user