@fecp/mobile
Version:
86 lines (85 loc) • 4.26 kB
JavaScript
/* empty css */
/* empty css */
/* empty css */
/* empty css */
/* empty css */
/* empty css */
/* empty css */
import { createBlock, openBlock, withCtx, createVNode, renderSlot } from "vue";
/* empty css */
/* empty css */
/* empty css */
/* empty css */
/* empty css */
/* empty css */
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
import { SwipeCell } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/swipe-cell/index.mjs";
import { showConfirmDialog } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.mjs";
import "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/index.mjs";
import { CellGroup } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/cell-group/index.mjs";
import { Button } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/button/index.mjs";
const _sfc_main = {
__name: "Card",
props: {
swipeDelete: {
type: Boolean,
default: false
}
},
emits: ["delete"],
setup(__props, { emit: __emit }) {
const emit = __emit;
const beforeClose = ({ position }) => {
switch (position) {
case "left":
case "cell":
case "outside":
return true;
case "right":
return new Promise((resolve) => {
showConfirmDialog({
title: "确定删除吗?"
}).then(() => {
emit("delete");
resolve(true);
}).catch(() => resolve(false));
});
}
};
return (_ctx, _cache) => {
const _component_van_button = Button;
const _component_van_swipe_cell = SwipeCell;
const _component_van_cell_group = CellGroup;
return openBlock(), createBlock(_component_van_cell_group, {
class: "fec-card",
inset: true,
border: true
}, {
default: withCtx(() => [
createVNode(_component_van_swipe_cell, {
disabled: !__props.swipeDelete,
"before-close": beforeClose
}, {
right: withCtx(() => [
createVNode(_component_van_button, {
square: "",
text: "删除",
type: "danger",
class: "fec-swipe-delete-button"
})
]),
default: withCtx(() => [
renderSlot(_ctx.$slots, "default", {}, void 0, true)
]),
_: 3
}, 8, ["disabled"])
]),
_: 3
});
};
}
};
const _Card = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-138f88dc"]]);
export {
_Card as default
};